MethodHandles Everywhere
summary
MethodHandles are shown as fast, composable function pointers that the JVM can inline: method handle trees combine direct calls, adapters like guardWithTest and catchException, and low-level ops such as varhandle compareAndSet and volatile reads. Java 9 adds loop combinators and VarHandle views (e.g., treating byte[] as longs) and a simpler try/finally. An experimental JRuby AST-to-MethodHandle compiler runs natively after raising the JIT threshold from 10,000 to 100,000, proving practical but with longer warmup.
AI-written summary · about
chapters (22)
- 0:00Intro
- 0:48Method Handles
- 1:50What Did We Need?
- 3:09JSR-292
- 3:54MethodHandle API
- 5:22Like Reflection?
- 8:52Invoking a Handle
- 10:10Hello, Handles!
- 11:18Combining Multiple Handles
- 14:05try/catch
- 14:52More Adaptations
- 17:44Missing Features
- 18:58try/finally
- 20:25Loops
- 21:31VarHandle
- 25:04InvokeBinder
- 26:11Basic Use
- 28:31Turing Complete?
- 29:04Ruby "Compiler"
- 34:16Results
- 35:40Better Streams
- 37:22Wrapping Up








