Skip to content

Instantly share code, notes, and snippets.

@alex
Created January 5, 2012 18:36
Show Gist options
  • Save alex/1566551 to your computer and use it in GitHub Desktop.
Save alex/1566551 to your computer and use it in GitHub Desktop.

Handling embedded pointers in the JIT

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment