Master the fundamental concepts of jit compilation through this focused micro-challenge.
HotSpot runs interpreter, then C1 (fast JIT), then C2 (optimizing JIT). V8 uses Ignition plus TurboFan. Warmup compiles cheap code first; hot code recompiles with heavier opts. Tiered strategy balances startup and peak speed.
Counter on backward branch increments. Threshold triggers next tier. OSR enters optimized loop mid-execution. Higher tiers assume more, guard less, inline more.
cLoading…
Production compilers embed this step inside a longer pipeline. GCC flows through cpp, cc1, assembly, and ld; Clang uses the driver, Sema, LLVM IR passes, and a target backend. LLVM bitcode, JVM bytecode, and WASM are other familiar IRs at the same layer. The exercise isolates one pass so you can test it alone before chaining it to the next stage.
You will implement tiered JIT compilation with multiple optimization levels. This exercise requires profiling counters, triggering compilation at thresholds, and replacing lower-tier code with higher-tier versions.
Implement tiered JIT compilation system.
Requirements:
Three hints are available for this task, revealed one at a time inside the code workspace so you can struggle productively before seeing them.
All starter code and reference implementations are available for your local setup.
View on Github