Index: runtime/vm/handles.h |
diff --git a/runtime/vm/handles.h b/runtime/vm/handles.h |
index acd8153a2a0a486bd051438aaeb55eea6e936e8b..12dbed9c03238ee2b731aff75c9bc3dde964636e 100644 |
--- a/runtime/vm/handles.h |
+++ b/runtime/vm/handles.h |
@@ -58,6 +58,15 @@ namespace dart { |
class ObjectPointerVisitor; |
+class HandleVisitor { |
+ public: |
+ virtual void Visit(uword* addr) = 0; |
+ |
+ virtual ~HandleVisitor() { |
+ } |
+}; |
+ |
+ |
template <int kHandleSizeInWords, int kHandlesPerChunk, int kOffsetOfRawPtr> |
class Handles { |
public: |
@@ -73,6 +82,9 @@ class Handles { |
// Visit all object pointers stored in the various handles. |
void VisitObjectPointers(ObjectPointerVisitor* visitor); |
+ // Visits all of the various handles. |
+ void Visit(HandleVisitor* visitor); |
+ |
// Allocates a handle in the current handle scope. This handle is valid only |
// in the current handle scope and is destroyed when the current handle |
// scope ends. |
@@ -142,6 +154,9 @@ class Handles { |
// Visit all object pointers in the handle block. |
void VisitObjectPointers(ObjectPointerVisitor* visitor); |
+ // Visit all of the handles in the handle block. |
+ void Visit(HandleVisitor* visitor); |
+ |
#if defined(DEBUG) |
// Zaps the free handle area to an uninitialized value. |
void ZapFreeHandles(); |