Chromium Code Reviews| Index: test/cctest/test-heap.cc |
| diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc |
| index 9e3eea4e7957dbfe66648014693ff9374cf84f68..7b936e63bce7ad4e6d1264b1af02a58e20c6f1fd 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 (!v8::V8::IdleNotification()); |
| + intptr_t new_size = HEAP->SizeOfObjects(); |
| + CHECK(new_size < old_size); |
|
Erik Corry
2011/11/22 12:29:26
I think we need more testing. There should be a t
|
| +} |