Creating efficient VM with JIT in Go
summary
A Go-based JDK implements a register-like IR and emits native AMD64 machine code at runtime, using a trampoline trick to call Go functions from JIT code and avoid Go runtime stack-map crashes. Objects use a common header with separate pointer and scalar areas—sized objects—and frames hold slots split for pointers and scalars so Go GC sees reachable pointers. Call latency measures ~10–20 ns for cross-language calls; interpreted VM is ~2x slower than OpenJDK. Tooling gaps: no source-level debugger, signal/GC edge cases, and production readiness requires much more work.
AI-written summary · about
chapters (15)
- 0:00Introduction and speaker intro
- 1:53Backstory and motivation
- 6:49Project goals and requirements
- 9:14Bytecode to machine code conversion
- 12:04Function frames and slots
- 15:32Calling JIT code from Go
- 18:20Trampoline technique for Go-Java interop
- 21:11Fast native function calls
- 21:53Object layout and memory allocation
- 26:26Limitations and challenges
- 28:53Performance benchmarks
- 31:16Original goals and execution speed
- 33:48Production readiness and use cases
- 35:33Memory consumption comparison
- 36:58Q&A session








