Chromium Code Reviews| Index: runtime/vm/heap.h |
| diff --git a/runtime/vm/heap.h b/runtime/vm/heap.h |
| index 6d8752ca98d3ddd8b27f1762578daf030f13b968..129ae57f111eda296287369af3a1ea22238cecb5 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; |
| @@ -159,6 +153,10 @@ class Heap { |
| // Verify that all pointers in the heap point to the heap. |
| bool Verify(MarkExpectation mark_expectation = kForbidMarked) const; |
| + // Like Verify, but does not wait for concurrent sweeper, so caller must |
| + // ensure thread-safety. |
| + bool VerifyGC(MarkExpectation mark_expectation = kForbidMarked) const; |
|
siva
2015/07/07 18:10:24
Can this be a private function?
koda
2015/07/07 22:46:39
Done.
|
| + |
| // Print heap sizes. |
| void PrintSizes() const; |
| @@ -284,6 +282,14 @@ 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; |
| + |
| // GC stats collection. |
| void RecordBeforeGC(Space space, GCReason reason); |
| void RecordAfterGC(); |
| @@ -342,6 +348,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(); |