State of java.lang.invoke
summary
Java 8u40 replaces the old method‑handle IR with Lambda forms and adds Lambda form sharing, cutting the number of Lambda forms from millions to thousands and yielding about a 4x metaspace reduction and ~4x fewer loaded classes on Box2D, faster startup/warmup and many Octane wins (some subtests improve 3x+). Problems include profile pollution and slower non‑constant method‑handle calls (up to ~20% regressions); fixes use per-method-handle profiling, precompilation and other VM tweaks landed in 8u60 and JDK9 EA.
AI-written summary · about
chapters (13)
- 0:00Intro
- 1:34Method Handles in JDK 7 GA
- 4:02The Grand Plan
- 9:43VM Anonymous Classes Constant Pool Patching
- 16:28Lambda Form Caching
- 17:36Sharing vs Customization
- 21:33Lambda Form Precompilation
- 31:01Non-Constant Method Handle Invocation
- 35:51Ultimate Sharing
- 43:05MethodHandle.asType() Better Caching/ Sharing
- 45:48Reduce stack consumption
- 50:00Lightweight Code Loading
- 59:28JEP 193: Variable Handles








