Ruby: Proposal to Upstream ZJIT
a year ago
- #JIT
- #Compiler
- #Ruby
- Proposal to upstream ZJIT, a next-generation Ruby JIT developed by Shopify.
- ZJIT introduces a Static Single Assignment (SSA) Intermediate Representation (IR) for better optimization and modularity.
- Aims to overcome YJIT's limitations in inlining and cross-instruction optimizations.
- Designed to be more approachable for contributors outside Shopify, fostering community involvement.
- Current status: Early development, supports x86-64 and arm64, with plans for Ruby 3.5 compatibility.
- Objectives include fast JIT-to-JIT calls, polymorphic inline caches, and dead-code elimination.
- Long-term goals include aggressive inlining, GC optimization, and allocation elision.
- Merging strategy involves keeping YJIT as default, with ZJIT opt-in via a command-line switch.
- Matz supports the upstreaming, trusting the team's approach.
- Discussion includes the benefits of a method-based JIT over LBBV for optimization and profiling.