changeset 40450:ff23a3122b79

8164485: Zero forms not properly generated Reviewed-by: psandoz
author redestad
date Fri, 19 Aug 2016 17:46:44 +0200
parents 5fbe26f13a4e
children 17dd00080a7c
files jdk/src/java.base/share/classes/java/lang/invoke/GenerateJLIClassesHelper.java jdk/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java
diffstat 2 files changed, 1 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- 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);