Basic block versioning
A JIT technique that compiles several versions of the same basic block, one per combination of known types — and only the versions that actually run.
Dynamic languages check types constantly. If one block has established that x is an integer, the next block can be compiled in a variant that already knows it, and the type check simply disappears. Versions are generated lazily, when execution first reaches them, so code only grows along the paths the program really takes. A per-block cap keeps the combinations from exploding.
Maxime Chevalier-Boisvert and Marc Feeley described the technique in 2015, built into the Higgs JavaScript JIT. It went mainstream when Chevalier-Boisvert led YJIT at Shopify, which shipped with Ruby 3.1 in December 2021. Unlike a tracing JIT there is nothing to record: the compiler looks at one block at a time and lets type knowledge flow forward.