Skip to content

Commit 48cf94e

Browse files
committed
Temp commit: Potential scan -> Nonrelocatable scan.
1 parent 301b8d1 commit 48cf94e

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

src/asm_writing/icinfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ bool ICInfo::isMegamorphic() {
340340
void 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
}

src/codegen/irgen/hooks.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ CompiledFunction::~CompiledFunction() {
784784
void 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
}

src/gc/gc.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff 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

8290
enum class GCKind : uint8_t {

0 commit comments

Comments
 (0)