Make OutOfMemory exception thrown from JS call into FatalProcessOutOfMemory as well.
authorantonm@chromium.org <antonm@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 17 Feb 2011 17:21:59 +0000 (17:21 +0000)
committerantonm@chromium.org <antonm@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 17 Feb 2011 17:21:59 +0000 (17:21 +0000)
That unifies the behaviour with CALL_HEAP_FUNCTION macro.

BUG=v8:1165

Review URL: http://codereview.chromium.org/6528050

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6844 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/execution.cc

index f484d8d..de8f0a4 100644 (file)
@@ -106,6 +106,11 @@ static Handle<Object> Invoke(bool construct,
   ASSERT(*has_pending_exception == Top::has_pending_exception());
   if (*has_pending_exception) {
     Top::ReportPendingMessages();
+    if (Top::pending_exception() == Failure::OutOfMemoryException()) {
+      if (!HandleScopeImplementer::instance()->ignore_out_of_memory()) {
+        V8::FatalProcessOutOfMemory("JS", true);
+      }
+    }
     return Handle<Object>();
   } else {
     Top::clear_pending_message();