8164485: Zero forms not properly generated
authorredestad
Fri, 19 Aug 2016 17:46:44 +0200
changeset 40450 ff23a3122b79
parent 40449 5fbe26f13a4e
child 40451 17dd00080a7c
8164485: Zero forms not properly generated Reviewed-by: psandoz
jdk/src/java.base/share/classes/java/lang/invoke/GenerateJLIClassesHelper.java
jdk/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java
--- a/jdk/src/java.base/share/classes/java/lang/invoke/GenerateJLIClassesHelper.java	Fri Aug 19 10:57:44 2016 -0700
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/GenerateJLIClassesHelper.java	Fri Aug 19 17:46:44 2016 +0200
@@ -43,18 +43,8 @@
         ArrayList<String> names = new ArrayList<>();
         HashSet<String> dedupSet = new HashSet<>();
         for (LambdaForm.BasicType type : LambdaForm.BasicType.values()) {
-            LambdaForm zero = LambdaForm.zeroForm(type);
-            String name = zero.kind.defaultLambdaName
-                    + "_" + zero.returnType().basicTypeChar();
-            // since zero is the same as identity for Void, we deduplicate
-            // aggressively to guard against this specifically and not get
-            // caught on future equivalences
-            if (dedupSet.add(name)) {
-                names.add(name);
-                forms.add(zero);
-            }
             LambdaForm identity = LambdaForm.identityForm(type);
-            name = identity.kind.defaultLambdaName
+            String name = identity.kind.defaultLambdaName
                    + "_" + identity.returnType().basicTypeChar();
             if (dedupSet.add(name)) {
                 names.add(name);
--- a/jdk/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java	Fri Aug 19 10:57:44 2016 -0700
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java	Fri Aug 19 17:46:44 2016 +0200
@@ -624,7 +624,6 @@
                 return resolveFrom(name, invokerType, DelegatingMethodHandle.Holder.class);
             }
             case DELEGATE:                  return resolveFrom(name, invokerType, DelegatingMethodHandle.Holder.class);
-            case ZERO:                      // fall-through
             case IDENTITY: {
                 name = name + "_" + form.returnType().basicTypeChar();
                 return resolveFrom(name, invokerType, LambdaForm.Holder.class);