来自 CallSite文件
A CallSite is a holder for a variable MethodHandle, which is called its target. An invokedynamic instruction linked to a CallSite delegates all calls to the site's current target. A CallSite may be associated with several invokedynamic instructions, or it may be "free floating", associated with none. In any case, it may be invoked through an associated method handle called its dynamic invoker.
问题:
invokedynamic
指示?编辑:
注意:我想知道编写代码/lambda 的不同方法,以便在程序中出现这 3 点。
最佳答案
MutableCallSite
中的目标或 VolatileCallSite
可以通过 CallSite#setTarget
更改CallSite
s 是“自由 float 的”。 编辑:我认为你误解了文档,我认为你永远不应该初始化
CallSite
直接来自您的代码,因为没有用,并且存在文档以告知它的作用,JVM 使用它为 invokedynamic
提供 MethodHandle操作说明。
关于java - 需要CallSite解释,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63668261/