JIT Compiler From the Ground Up
summary
HotSpot’s JIT story is concrete: a lightweight C1 compiler gets code running fast early (C1 ~10x vs interpreter), a slower C2 uses detailed profiles to speculate and optimize more deeply (compilation cost single-digit× C1, typical wins C2: 10%–2× over C1), and tiered compilation moves from interpreting to C1 to C2. Key mechanisms covered include profiling-based inlining, traps and deoptimization to recover correctness, escape analysis → scalar replacement (removes heap allocs), intrinsics for platform special cases, and fuzzing plus benchmarks for regression testing.
AI-written summary · about
chapters (15)
- 0:00Intro
- 0:49Big Picture
- 4:56Tiered Compilation
- 10:11Speculation & Traps
- 14:28Deoptimization
- 16:42Hoisting & Sinking
- 17:39Heuristics
- 20:56Inlining
- 24:21Code Quality
- 27:48Constant Folding
- 31:42Escape Analysis & Scalar Replacement
- 36:10Value Types
- 38:45Outside Contribution
- 40:26Intrinsics
- 42:48Working on Compilers
related talks
49mAn Introduction to JVM Performance
44mJIT Me Baby One More Time
01h 09mFrom Bytecode to Native Code in HotSpot JVM
35mJava at Speed: Building a Better JVM
01h 01mAn Introduction to JVM Performance
41mAn Introduction to JVM Performance
59mAn Introduction to JVM Performance
54mJava performance techniques The cost of HotSpot runtime optimizations
