Index: test/cctest/heap/heap-utils.cc |
diff --git a/test/cctest/heap/heap-utils.cc b/test/cctest/heap/heap-utils.cc |
index 8abc5c3b5c63d2e863080effda3d2c0a69a2396a..7d4d4bf40dc31d4d267ab6df5c3e7f18354a2078 100644 |
--- a/test/cctest/heap/heap-utils.cc |
+++ b/test/cctest/heap/heap-utils.cc |
@@ -18,10 +18,8 @@ void SealCurrentObjects(Heap* heap) { |
heap->CollectAllGarbage(); |
heap->CollectAllGarbage(); |
heap->mark_compact_collector()->EnsureSweepingCompleted(); |
- PageIterator it(heap->old_space()); |
heap->old_space()->EmptyAllocationInfo(); |
- while (it.has_next()) { |
- Page* page = it.next(); |
+ for (Page* page : *heap->old_space()) { |
page->MarkNeverAllocateForTesting(); |
} |
} |
@@ -143,9 +141,8 @@ void SimulateFullSpace(v8::internal::PagedSpace* space) { |
void AbandonCurrentlyFreeMemory(PagedSpace* space) { |
space->EmptyAllocationInfo(); |
- PageIterator pit(space); |
- while (pit.has_next()) { |
- pit.next()->MarkNeverAllocateForTesting(); |
+ for (Page* page : *space) { |
+ page->MarkNeverAllocateForTesting(); |
} |
} |