changeset 50424:800fac79fc02 condy-folding

more regression tests fixing
author vromero
date Fri, 27 Apr 2018 12:20:03 -0700
parents ef325d75b27a
children 1b996bb06569
files src/java.base/share/classes/java/lang/invoke/constant/ConstantDescs.java src/java.base/share/classes/java/lang/invoke/constant/ConstantMethodHandleDesc.java src/java.base/share/classes/java/lang/invoke/constant/ConstantMethodTypeDesc.java src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symtab.java test/langtools/tools/javac/varargs/6806876/T6806876.out
diffstat 5 files changed, 17 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/classes/java/lang/invoke/constant/ConstantDescs.java	Thu Apr 26 17:12:07 2018 +0100
+++ b/src/java.base/share/classes/java/lang/invoke/constant/ConstantDescs.java	Fri Apr 27 12:20:03 2018 -0700
@@ -180,10 +180,18 @@
     @Foldable
     static final ClassDesc CR_MethodTypeDesc = ClassDesc.of("java.lang.invoke.constant.MethodTypeDesc");
 
+    /** {@link ClassDesc} representing {@link ConstantMethodTypeDesc} */
+    @Foldable
+    static final ClassDesc CR_ConstantMethodTypeDesc = ClassDesc.of("java.lang.invoke.constant.ConstantMethodTypeDesc");
+
     /** {@link ClassDesc} representing {@link MethodHandleDesc} */
     @Foldable
     static final ClassDesc CR_MethodHandleDesc = ClassDesc.of("java.lang.invoke.constant.MethodHandleDesc");
 
+    /** {@link ClassDesc} representing {@link ConstantMethodHandleDesc} */
+    @Foldable
+    static final ClassDesc CR_ConstantMethodHandleDesc = ClassDesc.of("java.lang.invoke.constant.ConstantMethodHandleDesc");
+
     /** {@link ClassDesc} representing {@link VarHandleDesc} */
     @Foldable
     static final ClassDesc CR_VarHandleDesc = ClassDesc.of("java.lang.invoke.constant.VarHandleDesc");
@@ -355,7 +363,7 @@
 
     static final ConstantMethodHandleDesc BSM_METHODHANDLEDESC
             = ConstantDescs.ofConstantBootstrap(ClassDesc.of("java.lang.invoke.constant", "ConstantMethodHandleDesc"),
-                                                "constantBootstrap", CR_MethodHandleDesc,
+                                                "constantBootstrap", CR_ConstantMethodHandleDesc,
                                                 CR_String, CR_String, CR_String, CR_String);
 
     static final ConstantMethodHandleDesc BSM_ENUMDESC
--- a/src/java.base/share/classes/java/lang/invoke/constant/ConstantMethodHandleDesc.java	Thu Apr 26 17:12:07 2018 +0100
+++ b/src/java.base/share/classes/java/lang/invoke/constant/ConstantMethodHandleDesc.java	Fri Apr 27 12:20:03 2018 -0700
@@ -34,6 +34,7 @@
 import jdk.internal.lang.annotation.Foldable;
 
 import static java.lang.invoke.constant.ConstantDescs.BSM_METHODHANDLEDESC;
+import static java.lang.invoke.constant.ConstantDescs.CR_ConstantMethodHandleDesc;
 import static java.lang.invoke.constant.ConstantDescs.CR_MethodHandleDesc;
 import static java.lang.invoke.constant.ConstantUtils.validateClassOrInterface;
 import static java.lang.invoke.constant.ConstantUtils.validateMemberName;
@@ -187,7 +188,7 @@
 
     @Override
     public Optional<? extends ConstantDesc<? super ConstantDesc<MethodHandle>>> describeConstable(MethodHandles.Lookup lookup) {
-        return Optional.of(DynamicConstantDesc.of(BSM_METHODHANDLEDESC, CR_MethodHandleDesc)
+        return Optional.of(DynamicConstantDesc.of(BSM_METHODHANDLEDESC, CR_ConstantMethodHandleDesc)
                                               .withArgs(kind.toString(), owner.descriptorString(), name, type.descriptorString()));
     }
 
@@ -206,7 +207,7 @@
      *                described, as per JVMS 4.3.3
      * @return the {@linkplain MethodHandleDesc}
      */
-    public static MethodHandleDesc constantBootstrap(MethodHandles.Lookup lookup, String name, Class<ClassDesc> clazz,
+    public static ConstantMethodHandleDesc constantBootstrap(MethodHandles.Lookup lookup, String name, Class<ClassDesc> clazz,
                                                      String bsmKindName, String memberOwner, String memberName, String memberType) {
         return MethodHandleDesc.of(MethodHandleDesc.Kind.valueOf(bsmKindName),
                                    ClassDesc.ofDescriptor(memberOwner), memberName,
--- a/src/java.base/share/classes/java/lang/invoke/constant/ConstantMethodTypeDesc.java	Thu Apr 26 17:12:07 2018 +0100
+++ b/src/java.base/share/classes/java/lang/invoke/constant/ConstantMethodTypeDesc.java	Fri Apr 27 12:20:03 2018 -0700
@@ -36,6 +36,7 @@
 import java.util.regex.Pattern;
 
 import static java.lang.invoke.constant.ConstantDescs.BSM_METHODTYPEDESC;
+import static java.lang.invoke.constant.ConstantDescs.CR_ConstantMethodTypeDesc;
 import static java.lang.invoke.constant.ConstantDescs.CR_MethodTypeDesc;
 import static java.lang.invoke.constant.ConstantDescs.CR_String;
 import static java.util.Objects.requireNonNull;
@@ -179,7 +180,7 @@
 
     @Override
     public Optional<? extends ConstantDesc<? super ConstantDesc<MethodType>>> describeConstable(MethodHandles.Lookup lookup) {
-        return Optional.of(DynamicConstantDesc.of(BSM_METHODTYPEDESC, CR_MethodTypeDesc).withArgs(descriptorString()));
+        return Optional.of(DynamicConstantDesc.of(BSM_METHODTYPEDESC, CR_ConstantMethodTypeDesc).withArgs(descriptorString()));
     }
 
     /**
@@ -192,9 +193,9 @@
      * @param descriptor a method descriptor string for the method type, as per JVMS 4.3.3
      * @return the {@linkplain MethodTypeDesc}
      */
-    public static MethodTypeDesc constantBootstrap(MethodHandles.Lookup lookup, String name, Class<ClassDesc> clazz,
+    public static ConstantMethodTypeDesc constantBootstrap(MethodHandles.Lookup lookup, String name, Class<ClassDesc> clazz,
                                                    String descriptor) {
-        return MethodTypeDesc.ofDescriptor(descriptor);
+        return (ConstantMethodTypeDesc)MethodTypeDesc.ofDescriptor(descriptor);
     }
 
     @Override
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symtab.java	Thu Apr 26 17:12:07 2018 +0100
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symtab.java	Fri Apr 27 12:20:03 2018 -0700
@@ -171,8 +171,6 @@
     public final Type varHandleType;
     public final Type methodHandleType;
     public final Type methodHandlesLookupType;
-    public final Type classRefType;
-    public final Type dynamicConstantRefType;
     public final Type intrinsicsType;
     public final Type methodTypeType;
     public final Type foldableType;
@@ -499,8 +497,6 @@
         varHandleType = enterClass("java.lang.invoke.VarHandle");
         methodHandleType = enterClass("java.lang.invoke.MethodHandle");
         methodHandlesLookupType = enterClass("java.lang.invoke.MethodHandles$Lookup");
-        dynamicConstantRefType = enterClass("java.lang.invoke.constant.DynamicConstantRef");
-        classRefType = enterClass("java.lang.invoke.constant.ClassRef");
         intrinsicsType = enterClass("java.lang.invoke.Intrinsics");
         methodTypeType = enterClass("java.lang.invoke.MethodType");
         foldableType = enterClass("jdk.internal.lang.annotation.Foldable");
--- a/test/langtools/tools/javac/varargs/6806876/T6806876.out	Thu Apr 26 17:12:07 2018 +0100
+++ b/test/langtools/tools/javac/varargs/6806876/T6806876.out	Fri Apr 27 12:20:03 2018 -0700
@@ -1,4 +1,4 @@
-T6806876.java:11:32: compiler.warn.unchecked.generic.array.creation: java.lang.Number&java.lang.sym.SymbolicRef.OfSelf<? extends java.lang.Number&java.lang.sym.SymbolicRef.OfSelf<?>&java.lang.Comparable<? extends java.lang.Number&java.lang.sym.SymbolicRef.OfSelf<?>&java.lang.Comparable<?>>>&java.lang.Comparable<? extends java.lang.Number&java.lang.sym.SymbolicRef.OfSelf<? extends java.lang.Number&java.lang.sym.SymbolicRef.OfSelf<?>&java.lang.Comparable<?>>&java.lang.Comparable<?>>[]
+T6806876.java:11:32: compiler.warn.unchecked.generic.array.creation: java.lang.Number&java.lang.Comparable<? extends java.lang.Number&java.lang.Comparable<?>&java.lang.invoke.constant.ConstantDesc<? extends java.lang.Number&java.lang.Comparable<?>&java.lang.invoke.constant.ConstantDesc<?>&java.lang.invoke.constant.Constable<? extends java.lang.Number&java.lang.Comparable<?>&java.lang.invoke.constant.ConstantDesc<?>&java.lang.invoke.constant.Constable<?>>>&java.lang.invoke.constant.Constable<? extends java.lang.Number&java.lang.Comparable<?>&java.lang.invoke.constant.ConstantDesc<? extends java.lang.Number&java.lang.Comparable<?>&java.lang.invoke.constant.ConstantDesc<?>&java.lang.invoke.constant.Constable<?>>&java.lang.invoke.constant.Constable<?>>>&java.lang.invoke.constant.ConstantDesc<? extends java.lang.Number&java.lang.Comparable<? extends java.lang.Number&java.lang.Comparable<?>&java.lang.invoke.constant.ConstantDesc<?>&java.lang.invoke.constant.Constable<? extends java.lang.Number&java.lang.Comparable<?>&java.lang.invoke.constant.ConstantDesc<?>&java.lang.invoke.constant.Constable<?>>>&java.lang.invoke.constant.ConstantDesc<?>&java.lang.invoke.constant.Constable<? extends java.lang.Number&java.lang.Comparable<? extends java.lang.Number&java.lang.Comparable<?>&java.lang.invoke.constant.ConstantDesc<?>&java.lang.invoke.constant.Constable<?>>&java.lang.invoke.constant.ConstantDesc<?>&java.lang.invoke.constant.Constable<?>>>&java.lang.invoke.constant.Constable<? extends java.lang.Number&java.lang.Comparable<? extends java.lang.Number&java.lang.Comparable<?>&java.lang.invoke.constant.ConstantDesc<? extends java.lang.Number&java.lang.Comparable<?>&java.lang.invoke.constant.ConstantDesc<?>&java.lang.invoke.constant.Constable<?>>&java.lang.invoke.constant.Constable<?>>&java.lang.invoke.constant.ConstantDesc<? extends java.lang.Number&java.lang.Comparable<? extends java.lang.Number&java.lang.Comparable<?>&java.lang.invoke.constant.ConstantDesc<?>&java.lang.invoke.constant.Constable<?>>&java.lang.invoke.constant.ConstantDesc<?>&java.lang.invoke.constant.Constable<?>>&java.lang.invoke.constant.Constable<?>>[]
 T6806876.java:14:19: compiler.warn.unchecked.varargs.non.reifiable.type: T
 - compiler.err.warnings.and.werror
 1 error