Reduced code size by using shorter instruction encoding when possible.

Added a --help option to the shell sample and to the d8 shell.

Added visual studio project files for building the ARM simulator.

Fixed a number of ARM simulator issues.

Fixed bug in out-of-memory handling on ARM.

Implemented shell support for passing arguments to a script from the command line.

Fixed bug in date code that made certain date functions return -0 instead of 0 for dates before the epoch.

Restricted applications of eval so it can only be used in the context of the associated global object.

Treat byte-order marks as whitespace characters.


git-svn-id: http://v8.googlecode.com/svn/trunk@768 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/runtime.cc b/src/runtime.cc
index 6fe7cc6..1d40e4c 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -296,7 +296,9 @@
   Handle<String> pattern(raw_pattern);
   CONVERT_CHECKED(String, raw_flags, args[2]);
   Handle<String> flags(raw_flags);
-  return *RegExpImpl::Compile(re, pattern, flags);
+  Handle<Object> result = RegExpImpl::Compile(re, pattern, flags);
+  if (result.is_null()) return Failure::Exception();
+  return *result;
 }
 
 
@@ -5086,7 +5088,7 @@
     if (!done) {
       // If the candidate is not compiled compile it to reveal any inner
       // functions which might contain the requested source position.
-      CompileLazyShared(target, KEEP_EXCEPTION);
+      CompileLazyShared(target, KEEP_EXCEPTION, 0);
     }
   }
 
@@ -5392,6 +5394,7 @@
   Handle<Object> evaluation_function =
       Execution::Call(compiled_function, receiver, 0, NULL,
                       &has_pending_exception);
+  if (has_pending_exception) return Failure::Exception();
 
   Handle<Object> arguments = GetArgumentsObject(frame, function, code, &sinfo,
                                                 function_context);
@@ -5403,6 +5406,7 @@
   Handle<Object> result =
       Execution::Call(Handle<JSFunction>::cast(evaluation_function), receiver,
                       argc, argv, &has_pending_exception);
+  if (has_pending_exception) return Failure::Exception();
   return *result;
 }
 
@@ -5448,6 +5452,7 @@
   Handle<Object> result =
     Execution::Call(compiled_function, receiver, 0, NULL,
                     &has_pending_exception);
+  if (has_pending_exception) return Failure::Exception();
   return *result;
 }