From caad1de7701073b93de9c112efe62422644e4718 Mon Sep 17 00:00:00 2001 From: "yangguo@chromium.org" Date: Thu, 27 Mar 2014 09:59:07 +0000 Subject: [PATCH] Revert "Correctly OOM in the CEntryStub after retries." This reverts r20292 due to no-snapshot failures. TBR=svenpanne@chromium.org Review URL: https://codereview.chromium.org/214413005 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20293 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/arm/code-stubs-arm.cc | 6 ------ src/arm64/code-stubs-arm64.cc | 5 ----- src/assembler.cc | 6 ------ src/assembler.h | 1 - src/ia32/code-stubs-ia32.cc | 6 ------ src/mips/code-stubs-mips.cc | 6 ------ src/runtime.cc | 5 ----- src/runtime.h | 1 - src/serialize.cc | 5 ----- src/x64/code-stubs-x64.cc | 6 ------ test/cctest/test-heap.cc | 26 +------------------------- 11 files changed, 1 insertion(+), 72 deletions(-) diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc index 832296b..fe2095a 100644 --- a/src/arm/code-stubs-arm.cc +++ b/src/arm/code-stubs-arm.cc @@ -1685,12 +1685,6 @@ void CEntryStub::Generate(MacroAssembler* masm) { true, true); - { FrameScope scope(masm, StackFrame::MANUAL); - __ PrepareCallCFunction(0, r0); - __ CallCFunction( - ExternalReference::out_of_memory_function(masm->isolate()), 0, 0); - } - __ bind(&throw_termination_exception); __ ThrowUncatchable(r0); diff --git a/src/arm64/code-stubs-arm64.cc b/src/arm64/code-stubs-arm64.cc index 5b4c3c4..b6411d9 100644 --- a/src/arm64/code-stubs-arm64.cc +++ b/src/arm64/code-stubs-arm64.cc @@ -1764,11 +1764,6 @@ void CEntryStub::Generate(MacroAssembler* masm) { } __ SetStackPointer(jssp); - { FrameScope scope(masm, StackFrame::MANUAL); - __ CallCFunction( - ExternalReference::out_of_memory_function(masm->isolate()), 0, 0); - } - // Throw exceptions. // If we throw an exception, we can end up re-entering CEntryStub before we // pop the exit frame, so need to ensure that x21-x23 contain GC-safe values diff --git a/src/assembler.cc b/src/assembler.cc index 772b6d6..e53ca7c 100644 --- a/src/assembler.cc +++ b/src/assembler.cc @@ -1059,12 +1059,6 @@ ExternalReference ExternalReference::perform_gc_function(Isolate* isolate) { } -ExternalReference ExternalReference::out_of_memory_function(Isolate* isolate) { - return - ExternalReference(Redirect(isolate, FUNCTION_ADDR(Runtime::OutOfMemory))); -} - - ExternalReference ExternalReference::delete_handle_scope_extensions( Isolate* isolate) { return ExternalReference(Redirect( diff --git a/src/assembler.h b/src/assembler.h index 0349b06..b0eff94 100644 --- a/src/assembler.h +++ b/src/assembler.h @@ -748,7 +748,6 @@ class ExternalReference BASE_EMBEDDED { Isolate* isolate); static ExternalReference flush_icache_function(Isolate* isolate); static ExternalReference perform_gc_function(Isolate* isolate); - static ExternalReference out_of_memory_function(Isolate* isolate); static ExternalReference delete_handle_scope_extensions(Isolate* isolate); static ExternalReference get_date_field_function(Isolate* isolate); diff --git a/src/ia32/code-stubs-ia32.cc b/src/ia32/code-stubs-ia32.cc index ab29167..44f2472 100644 --- a/src/ia32/code-stubs-ia32.cc +++ b/src/ia32/code-stubs-ia32.cc @@ -2751,12 +2751,6 @@ void CEntryStub::Generate(MacroAssembler* masm) { true, true); - { FrameScope scope(masm, StackFrame::MANUAL); - __ PrepareCallCFunction(0, eax); - __ CallCFunction( - ExternalReference::out_of_memory_function(masm->isolate()), 0); - } - __ bind(&throw_termination_exception); __ ThrowUncatchable(eax); diff --git a/src/mips/code-stubs-mips.cc b/src/mips/code-stubs-mips.cc index 332ed4b..c119c8e 100644 --- a/src/mips/code-stubs-mips.cc +++ b/src/mips/code-stubs-mips.cc @@ -1794,12 +1794,6 @@ void CEntryStub::Generate(MacroAssembler* masm) { true, true); - { FrameScope scope(masm, StackFrame::MANUAL); - __ PrepareCallCFunction(0, v0); - __ CallCFunction( - ExternalReference::out_of_memory_function(masm->isolate()), 0); - } - __ bind(&throw_termination_exception); __ ThrowUncatchable(v0); diff --git a/src/runtime.cc b/src/runtime.cc index 8f4c4ca..41c91c5 100644 --- a/src/runtime.cc +++ b/src/runtime.cc @@ -15175,9 +15175,4 @@ void Runtime::PerformGC(Object* result, Isolate* isolate) { } -void Runtime::OutOfMemory() { - Heap::FatalProcessOutOfMemory("CALL_AND_RETRY_LAST", true); - UNREACHABLE(); -} - } } // namespace v8::internal diff --git a/src/runtime.h b/src/runtime.h index 58cd525..407bf6f 100644 --- a/src/runtime.h +++ b/src/runtime.h @@ -895,7 +895,6 @@ class Runtime : public AllStatic { // Helper functions used stubs. static void PerformGC(Object* result, Isolate* isolate); - static void OutOfMemory(); // Used in runtime.cc and hydrogen's VisitArrayLiteral. static Handle CreateArrayLiteralBoilerplate( diff --git a/src/serialize.cc b/src/serialize.cc index 4048886..45bc8f2 100644 --- a/src/serialize.cc +++ b/src/serialize.cc @@ -313,11 +313,6 @@ void ExternalReferenceTable::PopulateTable(Isolate* isolate) { RUNTIME_ENTRY, 1, "Runtime::PerformGC"); - // Runtime entries - Add(ExternalReference::out_of_memory_function(isolate).address(), - RUNTIME_ENTRY, - 2, - "Runtime::OutOfMemory"); Add(ExternalReference::delete_handle_scope_extensions(isolate).address(), RUNTIME_ENTRY, 4, diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc index c949a42..cfb7f75 100644 --- a/src/x64/code-stubs-x64.cc +++ b/src/x64/code-stubs-x64.cc @@ -2603,12 +2603,6 @@ void CEntryStub::Generate(MacroAssembler* masm) { true, true); - { FrameScope scope(masm, StackFrame::MANUAL); - __ PrepareCallCFunction(0); - __ CallCFunction( - ExternalReference::out_of_memory_function(masm->isolate()), 0); - } - __ bind(&throw_termination_exception); __ ThrowUncatchable(rax); diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc index 3ccc3d7..55bb466 100644 --- a/test/cctest/test-heap.cc +++ b/test/cctest/test-heap.cc @@ -3889,28 +3889,4 @@ TEST(AddInstructionChangesNewSpacePromotion) { g->Call(global, 1, args1); heap->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask); } - - -void OnFatalErrorExpectOOM(const char* location, const char* message) { - // Exit with 0 if the location matches our expectation. - exit(strcmp(location, "CALL_AND_RETRY_LAST")); -} - - -TEST(CEntryStubOOM) { - i::FLAG_allow_natives_syntax = true; - CcTest::InitializeVM(); - v8::HandleScope scope(CcTest::isolate()); - v8::V8::SetFatalErrorHandler(OnFatalErrorExpectOOM); - - CompileRun( - "%SetFlags('--gc-interval=1');" - "var a = [];" - "a.__proto__ = [];" - "a.unshift(1)"); - - // We should have run into an out of memory. - UNREACHABLE(); -} - -#endif // DEBUG +#endif -- 2.7.4