Java 之 invokedynamic

简述

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

参考

  1. <https://www.baeldung.com/java-invoke-dynamic>
  2. JSR 292 -<https://jcp.org/en/jsr/detail?id=292>
  3. <https://www.infoq.com/news/2008/05/jsr_292_edr/>
  4. <http://blog.headius.com/2008/09/first-taste-of-invokedynamic.html>
  5. <https://cr.openjdk.java.net/~jrose/pres/200910-BcsMeetCmbs.pdf>

更多

  1. [OpenJDK] Project proposal: Multi-Language VM
posted @ 2023-02-14 17:00  UPeRVv  阅读(21)  评论(0编辑  收藏  举报