| Index: test/cctest/heap/test-heap.cc
|
| diff --git a/test/cctest/heap/test-heap.cc b/test/cctest/heap/test-heap.cc
|
| index af5d2705dae15572ac32493f6b5c6c16c4e091db..08a6714a628f53f03a5b4d8630867a1de34ddce0 100644
|
| --- a/test/cctest/heap/test-heap.cc
|
| +++ b/test/cctest/heap/test-heap.cc
|
| @@ -4936,7 +4936,8 @@ TEST(NoWeakHashTableLeakWithIncrementalMarking) {
|
| i, i, i, i, i, i, i, i);
|
| CompileRun(source.start());
|
| }
|
| - heap->CollectAllGarbage();
|
| + // We have to abort incremental marking here to abandon black pages.
|
| + heap->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask);
|
| }
|
| int elements = 0;
|
| if (heap->weak_object_to_code_table()->IsHashTable()) {
|
| @@ -5456,6 +5457,9 @@ TEST(WeakCellsWithIncrementalMarking) {
|
| CHECK(weak_cell->value()->IsFixedArray());
|
| weak_cells[i] = inner_scope.CloseAndEscape(weak_cell);
|
| }
|
| + // Call collect all twice to make sure that we also cleared
|
| + // weak cells that were allocated on black pages.
|
| + heap->CollectAllGarbage();
|
| heap->CollectAllGarbage();
|
| CHECK_EQ(*survivor, weak_cells[0]->value());
|
| for (int i = 1; i < N; i++) {
|
|
|