Minimal Values Under the Hood
summary
An experimental JVM prototype implements value-capable classes derived at load time via bytecode generation and MethodHandles, producing flattened instances for arrays and fields and avoiding per-element headers. J9 adds a per-thread page-backed heap-buffered stack allocation to reduce interpreter heap churn, while the JIT generates register-passed field-wise calling sequences that eliminate many allocations; microbenchmarks show much simpler generated code and large speedups, though platform limits remain (alignment, atomicity, signature/adapter complexity and incomplete C2 support).
AI-written summary · about
chapters (19)
- 0:00Intro
- 3:16MVT: value types without value types
- 4:40Deriving the Value Class - 19
- 9:40Deriving the value class - HotSpot
- 11:11Value Types Flattening
- 12:15Array Flattening, not so simple
- 15:17Value Bytecodes
- 18:31Separate compilation breaking the calling convention
- 19:27Slot design alternatives
- 21:43Interpreter changes in HotSpot VM
- 23:01Hotspot interpreter on-heap / off-heap values
- 25:09Hotspot: thread local buffer management
- 26:17Hotspot: Values format
- 28:48Example: Complex number using POJOS
- 29:25Example: Complex number using Value Types
- 37:09Field Flattening
- 39:02Flattened fields - 19
- 41:26Value types methods and interfaces
- 43:02Value types and generic code
related talks
20mCache Me If You Can: Speed Up Your JVM with Project Valhalla
48mThe Next Generation of Java Runtimes
48mJava 9 Performance
35mJava at Speed: Building a Better JVM
55mNew Bytecodes, New Objects
56mValhalla Nullness Emotion
01h 01mAn Introduction to JVM Performance
57mJava Value Types: what is it and why are they important
