8199453: Enable link-time generation of constructor forms
Reviewed-by: alanb, psandoz, mchung
--- a/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java Mon Mar 12 17:49:08 2018 +0100
+++ b/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java Mon Mar 12 18:31:02 2018 +0100
@@ -669,6 +669,7 @@
case PUT_LONG: // fall-through
case PUT_FLOAT: // fall-through
case PUT_DOUBLE: // fall-through
+ case DIRECT_NEW_INVOKE_SPECIAL: // fall-through
case DIRECT_INVOKE_INTERFACE: // fall-through
case DIRECT_INVOKE_SPECIAL: // fall-through
case DIRECT_INVOKE_STATIC: // fall-through
@@ -1864,13 +1865,11 @@
* Emit a bogus method that just loads some string constants. This is to get the constants into the constant pool
* for debugging purposes.
*/
- private void bogusMethod(Object... os) {
+ private void bogusMethod(Object os) {
if (DUMP_CLASS_FILES) {
mv = cw.visitMethod(Opcodes.ACC_STATIC, "dummy", "()V", null, null);
- for (Object o : os) {
- mv.visitLdcInsn(o.toString());
- mv.visitInsn(Opcodes.POP);
- }
+ mv.visitLdcInsn(os.toString());
+ mv.visitInsn(Opcodes.POP);
mv.visitInsn(Opcodes.RETURN);
mv.visitMaxs(0, 0);
mv.visitEnd();
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/GenerateJLIClassesPlugin.java Mon Mar 12 17:49:08 2018 +0100
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/GenerateJLIClassesPlugin.java Mon Mar 12 18:31:02 2018 +0100
@@ -147,7 +147,8 @@
"L_I", "L_L", "L_V", "LD_L", "LF_L", "LI_I", "LII_L", "LLI_L",
"LL_V", "LL_L", "L3_L", "L4_L", "L5_L", "L6_L", "L7_L",
"L8_L", "L9_L", "L10_L", "L10I_L", "L10II_L", "L10IIL_L",
- "L11_L", "L12_L", "L13_L", "L14_L", "L14I_L", "L14II_L")
+ "L11_L", "L12_L", "L13_L", "L14_L", "L14I_L", "L14II_L"),
+ DMH_NEW_INVOKE_SPECIAL, Set.of("L_L", "LL_L")
);
}