File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -340,7 +340,7 @@ bool ICInfo::isMegamorphic() {
340340void ICInfo::visitGCReferences (gc::GCVisitor* v) {
341341 for (const auto & p : ics_list) {
342342 for (auto & slot : p->slots ) {
343- v->visitPotentialRange (&slot.gc_references [0 ], &slot.gc_references [slot.gc_references .size ()]);
343+ v->visitNonRelocatableRange (&slot.gc_references [0 ], &slot.gc_references [slot.gc_references .size ()]);
344344 }
345345 }
346346}
Original file line number Diff line number Diff line change @@ -784,7 +784,7 @@ CompiledFunction::~CompiledFunction() {
784784void CompiledFunction::visitAllCompiledFunctions (GCVisitor* visitor) {
785785 for (CompiledFunction* cf : all_compiled_functions) {
786786 for (const void * ptr : cf->pointers_in_code ) {
787- visitor->visitPotentialRedundant (const_cast <void *>(ptr));
787+ visitor->visitNonRelocatable (const_cast <void *>(ptr));
788788 }
789789 }
790790}
Original file line number Diff line number Diff line change @@ -77,6 +77,14 @@ class GCVisitor {
7777 virtual void visitRedundantRange (void ** start, void ** end) {}
7878 virtual void visitPotentialRedundant (void * p) {}
7979 virtual void visitPotentialRangeRedundant (void * const * start, void * const * end) {}
80+
81+ // Visit pointers to objects that we know cannot be moved.
82+ // This is often used to scan a pointer that's a copy of a pointer stored in a place that
83+ // we cannot easily scanned (like generated code).
84+ // This default to visitPotential for now (which also cannot be moved) but we may want to
85+ // change that later for performance.
86+ void visitNonRelocatable (void * p) { visitPotential (p); }
87+ void visitNonRelocatableRange (void ** start, void ** end) { visitPotentialRange (start, end); }
8088};
8189
8290enum class GCKind : uint8_t {
You can’t perform that action at this time.
0 commit comments