Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1533)

Unified Diff: runtime/vm/heap.h

Issue 2995543004: [vm, gc] Require a safepoint for heap iteration. (Closed)
Patch Set: explicit-thread Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/debugger_api_impl_test.cc ('k') | runtime/vm/heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/heap.h
diff --git a/runtime/vm/heap.h b/runtime/vm/heap.h
index 2acc2b188b602ca2a5f7e4760ff937d4beae3e5d..73f19529bc5e66a78e158bef43e46d829e7dbf9b 100644
--- a/runtime/vm/heap.h
+++ b/runtime/vm/heap.h
@@ -93,11 +93,6 @@ class Heap {
bool CodeContains(uword addr) const;
bool DataContains(uword addr) const;
- void IterateObjects(ObjectVisitor* visitor) const;
- void IterateOldObjects(ObjectVisitor* visitor) const;
- void IterateOldObjectsNoImagePages(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.
// The 'visitor' function should be set up to return true if the
@@ -360,23 +355,35 @@ class Heap {
friend class Become; // VisitObjectPointers
friend class Precompiler; // VisitObjects
- friend class ObjectGraph; // VisitObjects
friend class Unmarker; // VisitObjects
friend class ServiceEvent;
friend class PageSpace; // VerifyGC
friend class IsolateReloadContext; // VisitObjects
friend class ClassFinalizer; // VisitObjects
+ friend class HeapIterationScope; // VisitObjects
DISALLOW_COPY_AND_ASSIGN(Heap);
};
class HeapIterationScope : public StackResource {
public:
- explicit HeapIterationScope(bool writable = false);
+ explicit HeapIterationScope(Thread* thread, bool writable = false);
~HeapIterationScope();
+ void IterateObjects(ObjectVisitor* visitor) const;
+ void IterateObjectsNoImagePages(ObjectVisitor* visitor) const;
+ void IterateOldObjects(ObjectVisitor* visitor) const;
+ void IterateOldObjectsNoImagePages(ObjectVisitor* visitor) const;
+
+ void IterateVMIsolateObjects(ObjectVisitor* visitor) const;
+
+ void IterateObjectPointers(ObjectPointerVisitor* visitor,
+ bool validate_frames);
+ void IterateStackPointers(ObjectPointerVisitor* visitor,
+ bool validate_frames);
+
private:
- NoSafepointScope no_safepoint_scope_;
+ Heap* heap_;
PageSpace* old_space_;
bool writable_;
« no previous file with comments | « runtime/vm/debugger_api_impl_test.cc ('k') | runtime/vm/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698