Index: src/global-handles.cc |
diff --git a/src/global-handles.cc b/src/global-handles.cc |
index c749606a9d8428e89c51afae8a59ff333902b696..67cff7b0f5d227500d25d85a2e0a1e0cd94c4e98 100644 |
--- a/src/global-handles.cc |
+++ b/src/global-handles.cc |
@@ -949,34 +949,44 @@ void GlobalHandles::IterateAllRoots(ObjectVisitor* v) { |
DISABLE_CFI_PERF |
-void GlobalHandles::IterateAllRootsWithClassIds(ObjectVisitor* v) { |
+void GlobalHandles::ApplyPersistentHandleVisitor( |
+ v8::PersistentHandleVisitor* visitor, GlobalHandles::Node* node) { |
+ v8::Value* value = ToApi<v8::Value>(Handle<Object>(node->location())); |
+ visitor->VisitPersistentHandle( |
+ reinterpret_cast<v8::Persistent<v8::Value>*>(&value), |
+ node->wrapper_class_id()); |
+} |
+ |
+DISABLE_CFI_PERF |
+void GlobalHandles::IterateAllRootsWithClassIds( |
+ v8::PersistentHandleVisitor* visitor) { |
for (NodeIterator it(this); !it.done(); it.Advance()) { |
if (it.node()->IsRetainer() && it.node()->has_wrapper_class_id()) { |
- v->VisitEmbedderReference(it.node()->location(), |
- it.node()->wrapper_class_id()); |
+ ApplyPersistentHandleVisitor(visitor, it.node()); |
} |
} |
} |
DISABLE_CFI_PERF |
-void GlobalHandles::IterateAllRootsInNewSpaceWithClassIds(ObjectVisitor* v) { |
+void GlobalHandles::IterateAllRootsInNewSpaceWithClassIds( |
+ v8::PersistentHandleVisitor* visitor) { |
for (int i = 0; i < new_space_nodes_.length(); ++i) { |
Node* node = new_space_nodes_[i]; |
if (node->IsRetainer() && node->has_wrapper_class_id()) { |
- v->VisitEmbedderReference(node->location(), |
- node->wrapper_class_id()); |
+ ApplyPersistentHandleVisitor(visitor, node); |
} |
} |
} |
DISABLE_CFI_PERF |
-void GlobalHandles::IterateWeakRootsInNewSpaceWithClassIds(ObjectVisitor* v) { |
+void GlobalHandles::IterateWeakRootsInNewSpaceWithClassIds( |
+ v8::PersistentHandleVisitor* visitor) { |
for (int i = 0; i < new_space_nodes_.length(); ++i) { |
Node* node = new_space_nodes_[i]; |
if (node->has_wrapper_class_id() && node->IsWeak()) { |
- v->VisitEmbedderReference(node->location(), node->wrapper_class_id()); |
+ ApplyPersistentHandleVisitor(visitor, node); |
} |
} |
} |