Remove bogus test and add check for OOM in TryCall.
authoryangguo@chromium.org <yangguo@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 4 Dec 2012 09:51:52 +0000 (09:51 +0000)
committeryangguo@chromium.org <yangguo@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 4 Dec 2012 09:51:52 +0000 (09:51 +0000)
R=mstarzinger@chromium.org
BUG=

Review URL: https://chromiumcodereview.appspot.com/11412318

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

src/execution.cc
test/cctest/test-debug.cc

index 8942fb3..67f67e8 100644 (file)
@@ -211,6 +211,9 @@ Handle<Object> Execution::TryCall(Handle<JSFunction> func,
     Isolate* isolate = Isolate::Current();
     ASSERT(isolate->has_pending_exception());
     ASSERT(isolate->external_caught_exception());
+    if (isolate->is_out_of_memory() && !isolate->ignore_out_of_memory()) {
+      V8::FatalProcessOutOfMemory("OOM during Execution::TryCall");
+    }
     if (isolate->pending_exception() ==
         isolate->heap()->termination_exception()) {
       result = isolate->factory()->termination_exception();
index 8d97cd8..941fa68 100644 (file)
@@ -7532,18 +7532,4 @@ TEST(LiveEditDisabled) {
 }
 
 
-TEST(DebugContextOOM) {
-  v8::HandleScope scope;
-  LocalContext context;
-  v8::V8::IgnoreOutOfMemoryException();
-
-  v8::Local<v8::Value> result = CompileRun("a = '1'; while (true) a += a;");
-
-  // Check for out of memory state.
-  CHECK(result.IsEmpty());
-  CHECK(context->HasOutOfMemoryException());
-
-  v8::Debug::GetDebugContext();
-}
-
 #endif  // ENABLE_DEBUGGER_SUPPORT