| Index: runtime/vm/heap.h
|
| diff --git a/runtime/vm/heap.h b/runtime/vm/heap.h
|
| index 6d8752ca98d3ddd8b27f1762578daf030f13b968..43858837d33cfb7ea2bf7aeddaa5614f3a84cc77 100644
|
| --- a/runtime/vm/heap.h
|
| +++ b/runtime/vm/heap.h
|
| @@ -105,14 +105,9 @@ class Heap {
|
| bool CodeContains(uword addr) const;
|
| bool StubCodeContains(uword addr) const;
|
|
|
| - // Visit all pointers. Caller must ensure concurrent sweeper is not running,
|
| - // and the visitor must not allocate (see issue 21620).
|
| - void VisitObjectPointers(ObjectPointerVisitor* visitor) const;
|
| -
|
| - // Visit all objects, including FreeListElement "objects". Caller must ensure
|
| - // concurrent sweeper is not running, and the visitor must not allocate (see
|
| - // issue 21620).
|
| - void VisitObjects(ObjectVisitor* visitor) const;
|
| + void IterateObjects(ObjectVisitor* visitor) const;
|
| + void IterateOldObjects(ObjectVisitor* visitor) const;
|
| + void IterateObjectPointers(ObjectVisitor* visitor) const;
|
|
|
| // Find an object by visiting all pointers in the specified heap space,
|
| // the 'visitor' is used to determine if an object is found or not.
|
| @@ -121,8 +116,7 @@ class Heap {
|
| // point.
|
| // The 'visitor' function should return false if the object is not found,
|
| // traversal through the heap space continues.
|
| - // Returns null object if nothing is found. Must be called within a
|
| - // NoSafepointScope.
|
| + // Returns null object if nothing is found.
|
| RawInstructions* FindObjectInCodeSpace(FindObjectVisitor* visitor) const;
|
| RawObject* FindOldObject(FindObjectVisitor* visitor) const;
|
| RawObject* FindNewObject(FindObjectVisitor* visitor) const;
|
| @@ -284,6 +278,18 @@ class Heap {
|
| uword AllocateOld(intptr_t size, HeapPage::PageType type);
|
| uword AllocatePretenured(intptr_t size);
|
|
|
| + // Visit all pointers. Caller must ensure concurrent sweeper is not running,
|
| + // and the visitor must not allocate.
|
| + void VisitObjectPointers(ObjectPointerVisitor* visitor) const;
|
| +
|
| + // Visit all objects, including FreeListElement "objects". Caller must ensure
|
| + // concurrent sweeper is not running, and the visitor must not allocate.
|
| + void VisitObjects(ObjectVisitor* visitor) const;
|
| +
|
| + // Like Verify, but does not wait for concurrent sweeper, so caller must
|
| + // ensure thread-safety.
|
| + bool VerifyGC(MarkExpectation mark_expectation = kForbidMarked) const;
|
| +
|
| // GC stats collection.
|
| void RecordBeforeGC(Space space, GCReason reason);
|
| void RecordAfterGC();
|
| @@ -318,6 +324,7 @@ class Heap {
|
|
|
| friend class ServiceEvent;
|
| friend class GCTestHelper;
|
| + friend class PageSpace; // VerifyGC
|
| DISALLOW_COPY_AND_ASSIGN(Heap);
|
| };
|
|
|
| @@ -342,6 +349,18 @@ class NoSafepointScope : public ValueObject {
|
| #endif // defined(DEBUG)
|
|
|
|
|
| +class HeapIterationScope : public StackResource {
|
| + public:
|
| + HeapIterationScope();
|
| + ~HeapIterationScope();
|
| + private:
|
| + NoSafepointScope no_safepoint_scope_;
|
| + PageSpace* old_space_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(HeapIterationScope);
|
| +};
|
| +
|
| +
|
| class NoHeapGrowthControlScope : public StackResource {
|
| public:
|
| NoHeapGrowthControlScope();
|
|
|