background knowledge
- CallSite, a holder of MethodHandler, which is called its target.
- Field Descriptors: https://docs.oracle.com/javase/specs/jvms/se17/html/jvms-4.html#jvms-4.3.2
LambdaMetafactory
- Invoke Dynamic: https://jcp.org/en/jsr/detail?id=292
- lambda表达式反编译后对应的是opcode invokeDynamic
- invokeDynamic会创建一个CallSite来cache实际调用的方法。
- 生成lambda对应字节码的时刻:Compile Time or Runtime
- 例子:Record & String Concatenation
Helpful Command
javap -c -p -v Main
标签:invokeDynamic,jvms,CallSite,html,https,LambdaMetafactory From: https://www.cnblogs.com/N3ptuner/p/17015744.html