Index: src/heap/spaces.cc |
diff --git a/src/heap/spaces.cc b/src/heap/spaces.cc |
index 1879e0d44e7eb8b0a7039f37ce701307ba995589..a274fddf45d5b8fd2d31578ccc07bb416752e9e2 100644 |
--- a/src/heap/spaces.cc |
+++ b/src/heap/spaces.cc |
@@ -1431,6 +1431,10 @@ void PagedSpace::ReleasePage(Page* page) { |
heap()->memory_allocator()->Free<MemoryAllocator::kPreFreeAndQueue>(page); |
} |
+std::unique_ptr<ObjectIterator> PagedSpace::GetObjectIterator() { |
+ return std::unique_ptr<ObjectIterator>(new HeapObjectIterator(this)); |
+} |
+ |
#ifdef DEBUG |
void PagedSpace::Print() {} |
#endif |
@@ -1826,6 +1830,10 @@ void NewSpace::InlineAllocationStep(Address top, Address new_top, |
} |
} |
+std::unique_ptr<ObjectIterator> NewSpace::GetObjectIterator() { |
+ return std::unique_ptr<ObjectIterator>(new SemiSpaceIterator(this)); |
+} |
+ |
#ifdef VERIFY_HEAP |
// We do not use the SemiSpaceIterator because verification doesn't assume |
// that it works (it depends on the invariants we are checking). |
@@ -2119,6 +2127,12 @@ void NewSpace::SealIntermediateGeneration() { |
} |
} |
+std::unique_ptr<ObjectIterator> SemiSpace::GetObjectIterator() { |
+ // Use the NewSpace::NewObjectIterator to iterate the ToSpace. |
+ UNREACHABLE(); |
+ return std::unique_ptr<ObjectIterator>(); |
+} |
+ |
#ifdef DEBUG |
void SemiSpace::Print() {} |
#endif |
@@ -3170,6 +3184,9 @@ bool LargeObjectSpace::Contains(HeapObject* object) { |
return owned; |
} |
+std::unique_ptr<ObjectIterator> LargeObjectSpace::GetObjectIterator() { |
+ return std::unique_ptr<ObjectIterator>(new LargeObjectIterator(this)); |
+} |
#ifdef VERIFY_HEAP |
// We do not assume that the large object iterator works, because it depends |