The Sea of Nodes and the HotSpot JIT
summary
HotSpot C2 uses a compact graph IR called Sea of Nodes that stays in SSA form even through register allocation and scheduling, and C2-generated code runs roughly 99% of executed Java bytecodes worldwide and likely trillions of times per day. Optimizations are mostly local peephole graph-rewrites plus a global, monotonic GCP/type solver over hash-consed immutable types. Practical wins: aggressive inlining + inline caches, range-check peeling and unzipping, deoptimization for heroic fast-paths, and an expensive register allocator that tolerates heavy inlining.
AI-written summary · about
chapters (14)
- 0:00Introduction and background
- 3:17Sea of Nodes IR design
- 8:59Control flow in the graph
- 12:10Compiler passes and optimizations
- 17:50Peephole optimizations
- 21:45Type system and lattice
- 27:43Global constant propagation
- 33:22Inlining strategies
- 36:57Code motion and allocation
- 41:10Java-specific optimizations
- 48:38Heroic optimizations and deoptimization
- 51:11Deoptimization philosophy
- 53:58Safe points and debugging
- 57:11Summary and legacy
