Index: test/cctest/test-heap.cc |
diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc |
index 9e3eea4e7957dbfe66648014693ff9374cf84f68..b494336b002cf747e7f74f73110c15bce57a6d9e 100644 |
--- a/test/cctest/test-heap.cc |
+++ b/test/cctest/test-heap.cc |
@@ -1289,3 +1289,33 @@ TEST(CollectingAllAvailableGarbageShrinksNewSpace) { |
new_capacity = new_space->Capacity(); |
CHECK(old_capacity == new_capacity); |
} |
+ |
+ |
+TEST(IdleNotificationAdvancesIncrementalMarking) { |
+ if (!FLAG_incremental_marking || !FLAG_incremental_marking_steps) return; |
+ InitializeVM(); |
+ v8::HandleScope scope; |
+ const char* source = "function binom(n, m) {" |
+ " var C = [[1]];" |
+ " for (var i = 1; i <= n; ++i) {" |
+ " C[i] = [1];" |
+ " for (var j = 1; j < i; ++j) {" |
+ " C[i][j] = C[i-1][j-1] + C[i-1][j];" |
+ " }" |
+ " C[i][i] = 1;" |
+ " }" |
+ " return C[n][m];" |
+ "};" |
+ "binom(1000, 500)"; |
+ { |
+ AlwaysAllocateScope aa_scope; |
+ CompileRun(source); |
+ } |
+ if (HEAP->incremental_marking()->IsStopped()) { |
+ HEAP->incremental_marking()->Start(); |
+ } |
+ intptr_t old_size = HEAP->SizeOfObjects(); |
+ while (!HEAP->IdleNotification()); |
+ intptr_t new_size = HEAP->SizeOfObjects(); |
+ CHECK(new_size < old_size); |
+} |