Whose Memory is it Anyway
summary
Implements two concrete JIT passes for Ziji: a load elimination pass that replaces repeated load_field with cached values and a dead store elimination pass that removes redundant store_field writes during object initialization. Uses Ziji’s SSA HIR, Rust codebase, an effect system and lattice-based abstract interpretation to make the passes linear-time. Handles shape transitions, right barriers, C calls and aliasing by conservative cache flushes. Microbenchmarks show several× speedup over the interpreter and meaningfully closes the gap on instance-variable-heavy code.
AI-written summary · about
chapters (8)
- 0:00Introduction and background
- 3:35Memory optimization in JITs
- 8:53Object initialization in HIR
- 12:02Optimization pass sketch
- 16:46Abstract domains and lattices
- 21:25Practical lattice example
- 24:56Designing optimization passes
- 25:39Lessons learned and call to action
related talks
20mEvaluating YJIT’s Performance in a Production Context: A Pragmatic Approach
28mZJIT: The future of Ruby performance
37mKeynote: YJIT's Three Languages: the Fun of Code that Writes Code
34mDon't @ me! Faster Instance Variables with Object Shapes
30mYJIT - Building a new JIT Compiler inside CRuby
49mKeynote: Simple goal. Hard to accomplish
36mSome Assembly Required
37mMessage in a Bottle
