An Incremental Approach to JIT Construction
summary
This work builds a classroom-scale JIT that runs in-process using Rust and DynAsm and contrasts it with a NASM/AOT pipeline, implements a growing language up to booleans, control flow and mutation, and ships a working REPL with executable buffer that preserves globals across prompts. It demonstrates dynamic constant propagation from REPL-evaluated globals, implements first-call specialization (monomorphic fast paths keyed by observed tags), and documents mutation pitfalls including a student-found double-free and its fix.
AI-written summary · about
chapters (15)
- 0:00Incremental JIT construction
- 1:05Integer literals in AOT and JIT
- 3:32Unary operators and IR
- 4:58Bindings and stack management
- 5:21REPL for dynamic interactivity
- 6:24Global variables and constant propagation
- 8:12Booleans, control flow, tagged data
- 9:37Optimizing tag checks with type inference
- 11:19Top-level functions and sequential evaluation
- 12:23First call specialization
- 16:16JIT power with mid-execution optimizations
- 16:57Challenges with mutation
- 19:04Teaching JIT in compilers courses
- 23:38Summary and resources
- 24:00Q&A
related talks
20mBYOJ: Build your own JIT with Ruby
19mReusing Just-in-Time Compiled Code
01h 04mJust-in-Time Compilation: The Next Big Thing?
52mImplementing a Simple JVM in Rust
50mJIT and AOT in the CLR
44mJIT Me Baby One More Time
40mJoy of Meta-Tracing Just-in-Time Compilation: More Than Just a VM Generator
43mCreate your own Interpreter with a JIT in 1 hour
