So it turns out, what we do now is really silly. We just iterate over every
ConstPtr()
(these are GC pointer boxes within the JIT's optimizers that
refer to concrete pointers) and run the GC until the object is non-movable.
This isn't particularly bad with our current default GC, because it has two
generations so a single collection promotes all the ConstPtrs
to
non-movable (and in practice they were very likely non-movable before we even
try to force it). The more intelligent approach would be to have each piece of
assembler track the locations of the embedded pointers and let the GC rewrite
these like it does with every other location.
Previously our solution was to rewrite any ConstrPtr()
which could move to
reading it out of constant-list on the loop object. The GC would then rewrite
this like normal memory.