找到你要的答案

Q:CONSTANT_MethodHandle_info and CONSTANT_MethodType_info

Q:constant_methodhandle_info和constant_methodtype_info

In what situation can Java 7 compiler generate CONSTANT_MethodHandle_info and CONSTANT_MethodType_info constant pool entries?. Is it possible? Or they are completly used only with invokedynamic instruction and therefore never generated by Java 7 compliant compiler?

In what situation can Java 7 compiler generate constant_methodhandle_info和constant_methodtype_info constant pool entries?. Is it possible? Or they are completly used only with invokedynamic instruction and therefore never generated by Java 7 compliant compiler?

answer1: 回答1:

javac 7 does not generate these entries. But you know, JVM is not only for Java language. For example, groovy compiler may generate JDK 7 compatible bytecode that has invokedynamic and the corresponding constant pool entries.

javac 7不产生这些条目。但你知道,JVM不仅是java语言。例如,Groovy的编译器可能生成JDK 7兼容的字节码,invokedynamic和对应的常量池入口。

java  jvm