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

Unified Diff: test/cctest/test-heap.cc

Issue 214473003: Reland "Correctly OOM in the CEntryStub after retries." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/x64/code-stubs-x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-heap.cc
diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc
index 55bb466416fa352a6785cd79c757f272be04d0d1..c1f20f1f06eb185ab91fd521589832304e0b9d57 100644
--- a/test/cctest/test-heap.cc
+++ b/test/cctest/test-heap.cc
@@ -3889,4 +3889,27 @@ TEST(AddInstructionChangesNewSpacePromotion) {
g->Call(global, 1, args1);
heap->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask);
}
-#endif
+
+
+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);
+
+ v8::Handle<v8::Value> result = CompileRun(
+ "%SetFlags('--gc-interval=1');"
+ "var a = [];"
+ "a.__proto__ = [];"
+ "a.unshift(1)");
+
+ CHECK(result->IsNumber());
+}
+
+#endif // DEBUG
« 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