Chromium Code Reviews| Index: test/cctest/test-heap.cc |
| diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc |
| index 64075d26b4367bf17939c26c972b98bc2c868549..0576fc7ffefb98c5fb4449fe5fc2e0fcb95d2380 100644 |
| --- a/test/cctest/test-heap.cc |
| +++ b/test/cctest/test-heap.cc |
| @@ -1061,8 +1061,8 @@ TEST(TestCodeFlushing) { |
| Handle<JSFunction> function(JSFunction::cast(func_value)); |
| CHECK(function->shared()->is_compiled()); |
| - // The code will survive at least two GCs. |
| - HEAP->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask); |
| + // The code will survive at least one GC (it will be pre-aged so may not |
| + // survive further). |
|
Hannes Payer (out of office)
2013/09/16 14:31:45
Since we have the mode now which is turned on on m
rmcilroy
2013/09/16 15:45:47
Sounds like a plan. Done.
|
| HEAP->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask); |
| CHECK(function->shared()->is_compiled()); |
| @@ -1110,7 +1110,17 @@ TEST(TestCodeFlushingIncremental) { |
| Handle<JSFunction> function(JSFunction::cast(func_value)); |
| CHECK(function->shared()->is_compiled()); |
| - // The code will survive at least two GCs. |
| + // The code will survive at least one GC (it will be pre-aged so may not |
| + // survive further). |
| + HEAP->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask); |
| + CHECK(function->shared()->is_compiled()); |
| + |
| + // Execute the function again to ensure it is reset to the young age. |
| + { v8::HandleScope scope(CcTest::isolate()); |
| + CompileRun("foo();"); |
| + } |
| + |
| + // The code will survive at least two GC now that it is young again. |
| HEAP->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask); |
| HEAP->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask); |
| CHECK(function->shared()->is_compiled()); |
| @@ -1247,9 +1257,9 @@ TEST(TestCodeFlushingIncrementalAbort) { |
| Handle<JSFunction> function(JSFunction::cast(func_value)); |
| CHECK(function->shared()->is_compiled()); |
| - // The code will survive at least two GCs. |
| - heap->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask); |
| - heap->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask); |
| + // The code will survive at least one GC (it will be pre-aged so may not |
| + // survive further). |
| + HEAP->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask); |
| CHECK(function->shared()->is_compiled()); |
| // Bump the code age so that flushing is triggered. |