Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: test/cctest/test-heap.cc

Issue 213193011: Correctly OOM in the CEntryStub after retries. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: moved to debug-only as discussed Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/x64/code-stubs-x64.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 3871 matching lines...) Expand 10 before | Expand all | Expand 10 after
3882 3882
3883 v8::Handle<v8::Object> global = CcTest::global(); 3883 v8::Handle<v8::Object> global = CcTest::global();
3884 v8::Handle<v8::Function> g = 3884 v8::Handle<v8::Function> g =
3885 v8::Handle<v8::Function>::Cast(global->Get(v8_str("crash"))); 3885 v8::Handle<v8::Function>::Cast(global->Get(v8_str("crash")));
3886 v8::Handle<v8::Value> args1[] = { v8_num(1) }; 3886 v8::Handle<v8::Value> args1[] = { v8_num(1) };
3887 heap->DisableInlineAllocation(); 3887 heap->DisableInlineAllocation();
3888 heap->set_allocation_timeout(1); 3888 heap->set_allocation_timeout(1);
3889 g->Call(global, 1, args1); 3889 g->Call(global, 1, args1);
3890 heap->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask); 3890 heap->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask);
3891 } 3891 }
3892 #endif 3892
3893
3894 void OnFatalErrorExpectOOM(const char* location, const char* message) {
3895 // Exit with 0 if the location matches our expectation.
3896 exit(strcmp(location, "CALL_AND_RETRY_LAST"));
3897 }
3898
3899
3900 TEST(CEntryStubOOM) {
3901 i::FLAG_allow_natives_syntax = true;
3902 CcTest::InitializeVM();
3903 v8::HandleScope scope(CcTest::isolate());
3904 v8::V8::SetFatalErrorHandler(OnFatalErrorExpectOOM);
3905
3906 CompileRun(
3907 "%SetFlags('--gc-interval=1');"
3908 "var a = [];"
3909 "a.__proto__ = [];"
3910 "a.unshift(1)");
3911
3912 // We should have run into an out of memory.
3913 UNREACHABLE();
3914 }
3915
3916 #endif // DEBUG
OLDNEW
« no previous file with comments | « src/x64/code-stubs-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698