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

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

Issue 194883003: Make sure tagged binary op instructions change new space promotion. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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/hydrogen-instructions.h ('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 933172e2dc01007f7367ab0bc1bb484ebd92af81..74fb9bc5dd1cc560312bc5bd823966633e37984e 100644
--- a/test/cctest/test-heap.cc
+++ b/test/cctest/test-heap.cc
@@ -3697,3 +3697,45 @@ TEST(ObjectsInOptimizedCodeAreWeak) {
ASSERT(code->marked_for_deoptimization());
}
+
+
+TEST(AddInstructionChangesNewSpacePromotion) {
+ i::FLAG_allow_natives_syntax = true;
+ i::FLAG_expose_gc = true;
+ i::FLAG_stress_compaction = true;
+ i::FLAG_gc_interval = 1000;
+ CcTest::InitializeVM();
+ if (!i::FLAG_allocation_site_pretenuring) return;
+ v8::HandleScope scope(CcTest::isolate());
+ Isolate* isolate = CcTest::i_isolate();
+ Heap* heap = isolate->heap();
+
+ CompileRun(
+ "function add(a, b) {"
+ " return a + b;"
+ "}"
+ "add(1, 2);"
+ "add(\"a\", \"b\");"
+ "var oldSpaceObject;"
+ "gc();"
+ "function crash(x) {"
+ " var object = {a: null, b: null};"
+ " var result = add(1.5, x | 0);"
+ " object.a = result;"
+ " oldSpaceObject = object;"
+ " return object;"
+ "}"
+ "crash(1);"
+ "crash(1);"
+ "%OptimizeFunctionOnNextCall(crash);"
+ "crash(1);");
+
+ v8::Handle<v8::Object> global = CcTest::global();
+ v8::Handle<v8::Function> g =
+ v8::Handle<v8::Function>::Cast(global->Get(v8_str("crash")));
+ v8::Handle<v8::Value> args1[] = { v8_num(1) };
+ heap->DisableInlineAllocation();
+ heap->set_allocation_timeout(1);
+ g->Call(global, 1, args1);
+ heap->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask);
+}
« no previous file with comments | « src/hydrogen-instructions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698