File tree Expand file tree Collapse file tree 5 files changed +16
-4
lines changed
Expand file tree Collapse file tree 5 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -1615,6 +1615,12 @@ class V8_EXPORT Isolate {
16151615 V8_DEPRECATE_SOON (" Will be removed without replacement. crbug.com/v8/14172" )
16161616 void VisitExternalResources (ExternalResourceVisitor* visitor);
16171617
1618+ /* *
1619+ * Iterates through all the persistent handles in the current isolate's heap
1620+ * that have class_ids.
1621+ */
1622+ void VisitHandlesWithClassIds (PersistentHandleVisitor* visitor);
1623+
16181624 /* *
16191625 * Check if this isolate is in use.
16201626 * True if at least one thread Enter'ed this isolate.
Original file line number Diff line number Diff line change @@ -10163,6 +10163,12 @@ bool Isolate::IsInUse() {
1016310163 return i_isolate->IsInUse ();
1016410164}
1016510165
10166+ void Isolate::VisitHandlesWithClassIds (PersistentHandleVisitor* visitor) {
10167+ i::Isolate* i_isolate = reinterpret_cast <i::Isolate*>(this );
10168+ i::DisallowGarbageCollection no_gc;
10169+ i_isolate->global_handles ()->IterateAllRootsWithClassIds (visitor);
10170+ }
10171+
1016610172void Isolate::SetAllowAtomicsWait (bool allow) {
1016710173 i::Isolate* i_isolate = reinterpret_cast <i::Isolate*>(this );
1016810174 i_isolate->set_allow_atomics_wait (allow);
Original file line number Diff line number Diff line change @@ -944,10 +944,10 @@ void GlobalHandles::ApplyPersistentHandleVisitor(
944944 node->wrapper_class_id ());
945945}
946946
947- void GlobalHandles::IterateAllRootsForTesting (
947+ void GlobalHandles::IterateAllRootsWithClassIds (
948948 v8::PersistentHandleVisitor* visitor) {
949949 for (Node* node : *regular_nodes_) {
950- if (node->IsWeakOrStrongRetainer ()) {
950+ if (node->IsWeakOrStrongRetainer () && node-> has_wrapper_class_id () ) {
951951 ApplyPersistentHandleVisitor (visitor, node);
952952 }
953953 }
Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ class V8_EXPORT_PRIVATE GlobalHandles final {
125125 size_t handles_count () const ;
126126 size_t last_gc_custom_callbacks () const { return last_gc_custom_callbacks_; }
127127
128- void IterateAllRootsForTesting (v8::PersistentHandleVisitor* v);
128+ void IterateAllRootsWithClassIds (v8::PersistentHandleVisitor* v);
129129
130130#ifdef DEBUG
131131 void PrintStats ();
Original file line number Diff line number Diff line change @@ -1615,7 +1615,7 @@ class EmbedderGraphBuilder : public v8::PersistentHandleVisitor {
16151615 EmbedderGraphBuilder builder (isolate, graph);
16161616 reinterpret_cast <i::Isolate*>(isolate)
16171617 ->global_handles ()
1618- ->IterateAllRootsForTesting (&builder);
1618+ ->IterateAllRootsWithClassIds (&builder);
16191619 }
16201620
16211621 void VisitPersistentHandle (v8::Persistent<v8::Value>* value,
You can’t perform that action at this time.
0 commit comments