Let's Talk About Invokedynamic
summary
Invokedynamic arrives as a new JVM bytecode plus a fast API of method handles and call sites, letting language runtimes wire up calls that JIT as well as static Java. Examples show use of ASM, Jade script and an invoke binder DSL, a mutable callsite that flips targets, guardWithTest/switchPoint adaptations, and a tiny demo language “stupidscript” compiled to invokedynamic. Claims: ~200 JVM opcodes predate this change, invokedynamic ships in Java 7, powers Java 8 lambdas, and method handles run far faster than reflection and close to direct calls.
AI-written summary · about
chapters (11)
- 0:00Introduction to JRuby
- 2:09History of invokedynamic
- 4:00What is invokedynamic?
- 6:33Method Handle API
- 13:07Adapting Method Handles
- 18:30Flow Control Techniques
- 24:03JVM Bytecode Basics
- 30:36Implementing Bootstrap Methods
- 34:26Dynamic Call Site Switching
- 37:32Dynamic Dispatch Example
- 43:43Conclusion and Q&A








