简述
Add a new bytecode, invokedynamic, that supports efficient and flexible execution of method invocations in the absence of static type information.
-- JSR 292 - Description
First let us describe invokedynamic. It is a 5-byte instruction similar to invokeinterface, but it has no built-in scope, receiver, or dispatch behavior.
-- Bytecodes meet Combinators: invokedynamic on the JVM
调用
Part 1. method handles
Part 2. Method handles can be constructed, combined, and invoked in all kinds of useful patterns.
Part 3: a bootstrap method (BSM)
-- 200910-BcsMeetCmbs
参考
- <https://www.baeldung.com/java-invoke-dynamic>
- JSR 292 -<https://jcp.org/en/jsr/detail?id=292>
- <https://www.infoq.com/news/2008/05/jsr_292_edr/>
- <http://blog.headius.com/2008/09/first-taste-of-invokedynamic.html>
- <https://cr.openjdk.java.net/~jrose/pres/200910-BcsMeetCmbs.pdf>
更多
- [OpenJDK] Project proposal: Multi-Language VM
- http://cr.openjdk.java.net/~briangoetz/lambda/lambda-translation.html
- Java 8 的 Lambda 表达式为什么要基于 invokedynamic? - RednaxelaFX
- 关于OpenJDK对Java 8 lambda表达式的运行时实现的查看方式 - RednaxelaFX