Index: runtime/vm/handles_impl.h |
diff --git a/runtime/vm/handles_impl.h b/runtime/vm/handles_impl.h |
index 64abd942c0abe9b64611a38ed7363457f256aed9..9d82cd35001380b068253784b23eca8474fad807 100644 |
--- a/runtime/vm/handles_impl.h |
+++ b/runtime/vm/handles_impl.h |
@@ -30,6 +30,26 @@ void Handles<kHandleSizeInWords, |
} |
+template <int kHandleSizeInWords, int kHandlesPerChunk, int kOffsetOfRawPtr> |
+void Handles<kHandleSizeInWords, |
+ kHandlesPerChunk, |
+ kOffsetOfRawPtr>::Visit(HandleVisitor* visitor) { |
+ // Visit all zone handles. |
+ HandlesBlock* block = zone_blocks_; |
+ while (block != NULL) { |
+ block->Visit(visitor); |
+ block = block->next_block(); |
+ } |
+ |
+ // Visit all scoped handles. |
+ block = &first_scoped_block_; |
+ do { |
+ block->Visit(visitor); |
+ block = block->next_block(); |
+ } while (block != NULL); |
+} |
+ |
+ |
// Figure out the current handle scope using the current Isolate and |
// allocate a handle in that scope. The function assumes that a |
// current Isolate, current zone and current handle scope exist. It |
@@ -283,6 +303,17 @@ void Handles<kHandleSizeInWords, |
} |
+template <int kHandleSizeInWords, int kHandlesPerChunk, int kOffsetOfRawPtr> |
+void Handles<kHandleSizeInWords, |
+ kHandlesPerChunk, |
+ kOffsetOfRawPtr>::HandlesBlock::Visit(HandleVisitor* visitor) { |
+ ASSERT(visitor != NULL); |
+ for (intptr_t i = 0; i < next_handle_slot_; i += kHandleSizeInWords) { |
+ visitor->Visit(&data_[i + kOffsetOfRawPtr/kWordSize]); |
+ } |
+} |
+ |
+ |
#if defined(DEBUG) |
template <int kHandleSizeInWords, int kHandlesPerChunk, int kOffsetOfRawPtr> |
void Handles<kHandleSizeInWords, |