changeset 49010:52f33c9785b7 condy-folding

adding name and type to the condy returned by toSymbolicRef
author vromero
date Fri, 26 Jan 2018 15:47:40 -0500
parents 96d06dbff0fe
children 780d894a2aec
files src/java.base/share/classes/java/lang/sym/ClassRef.java src/java.base/share/classes/java/lang/sym/DynamicConstantRef.java src/java.base/share/classes/java/lang/sym/EnumRef.java src/java.base/share/classes/java/lang/sym/IndyRef.java src/java.base/share/classes/java/lang/sym/MethodHandleRef.java src/java.base/share/classes/java/lang/sym/MethodTypeRef.java src/java.base/share/classes/java/lang/sym/VarHandleRef.java
diffstat 7 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/classes/java/lang/sym/ClassRef.java	Thu Jan 25 22:07:34 2018 +0100
+++ b/src/java.base/share/classes/java/lang/sym/ClassRef.java	Fri Jan 26 15:47:40 2018 -0500
@@ -227,7 +227,7 @@
 
     @Override
     public Optional<? extends SymbolicRef<Class<?>>> toSymbolicRef(MethodHandles.Lookup lookup) {
-        return Optional.of(DynamicConstantRef.<Class<?>>of(SymbolicRefs.BSM_INVOKE)
+        return Optional.of(DynamicConstantRef.<Class<?>>of(SymbolicRefs.BSM_INVOKE, SymbolicRefs.CR_ClassRef)
                                    .withArgs(SymbolicRefs.MHR_CLASSREF_FACTORY, descriptor));
     }
 
--- a/src/java.base/share/classes/java/lang/sym/DynamicConstantRef.java	Thu Jan 25 22:07:34 2018 +0100
+++ b/src/java.base/share/classes/java/lang/sym/DynamicConstantRef.java	Fri Jan 26 15:47:40 2018 -0500
@@ -263,7 +263,7 @@
         args[2] = name;
         args[3] = type;
         System.arraycopy(bootstrapArgs, 0, args, 4, bootstrapArgs.length);
-        return Optional.of(DynamicConstantRef.<T>of(SymbolicRefs.BSM_INVOKE).withArgs(args));
+        return Optional.of(DynamicConstantRef.<T>of(SymbolicRefs.BSM_INVOKE, name, SymbolicRefs.CR_DynamicConstantRef).withArgs(args));
     }
 
     @Override
--- a/src/java.base/share/classes/java/lang/sym/EnumRef.java	Thu Jan 25 22:07:34 2018 +0100
+++ b/src/java.base/share/classes/java/lang/sym/EnumRef.java	Fri Jan 26 15:47:40 2018 -0500
@@ -67,7 +67,7 @@
         Optional<? extends SymbolicRef<Class<?>>> classRefRef = enumClass().toSymbolicRef(lookup);
         if (!classRefRef.isPresent())
             return Optional.empty();
-        return Optional.of(DynamicConstantRef.<E>of(SymbolicRefs.BSM_INVOKE)
+        return Optional.of(DynamicConstantRef.<E>of(SymbolicRefs.BSM_INVOKE, name(), SymbolicRefs.CR_EnumRef)
                                    .withArgs(SymbolicRefs.MHR_ENUMREF_FACTORY, classRefRef.get(), constantName()));
     }
 
--- a/src/java.base/share/classes/java/lang/sym/IndyRef.java	Thu Jan 25 22:07:34 2018 +0100
+++ b/src/java.base/share/classes/java/lang/sym/IndyRef.java	Fri Jan 26 15:47:40 2018 -0500
@@ -196,7 +196,7 @@
         args[2] = name;
         args[3] = type;
         System.arraycopy(bootstrapArgs, 0, args, 4, bootstrapArgs.length);
-        return Optional.of(DynamicConstantRef.of(SymbolicRefs.BSM_INVOKE).withArgs(args));
+        return Optional.of(DynamicConstantRef.of(SymbolicRefs.BSM_INVOKE, SymbolicRefs.CR_IndyRef).withArgs(args));
     }
 
     @Override
--- a/src/java.base/share/classes/java/lang/sym/MethodHandleRef.java	Thu Jan 25 22:07:34 2018 +0100
+++ b/src/java.base/share/classes/java/lang/sym/MethodHandleRef.java	Fri Jan 26 15:47:40 2018 -0500
@@ -301,7 +301,7 @@
         Optional<? extends SymbolicRef<MethodType>> typeRefRef = type.toSymbolicRef(lookup);
         if (!kindRef.isPresent() || !classRefRef.isPresent() || !typeRefRef.isPresent())
             return Optional.empty();
-        return Optional.of(DynamicConstantRef.<MethodHandle>of(SymbolicRefs.BSM_INVOKE)
+        return Optional.of(DynamicConstantRef.<MethodHandle>of(SymbolicRefs.BSM_INVOKE, name, SymbolicRefs.CR_MethodHandleRef)
                                    .withArgs(SymbolicRefs.MHR_METHODHANDLEREF_FACTORY, kindRef.get(), classRefRef.get(), name, typeRefRef.get()));
     }
 
--- a/src/java.base/share/classes/java/lang/sym/MethodTypeRef.java	Thu Jan 25 22:07:34 2018 +0100
+++ b/src/java.base/share/classes/java/lang/sym/MethodTypeRef.java	Fri Jan 26 15:47:40 2018 -0500
@@ -235,7 +235,7 @@
 
     @Override
     public Optional<? extends SymbolicRef<MethodType>> toSymbolicRef(MethodHandles.Lookup lookup) {
-        return Optional.of(DynamicConstantRef.<MethodType>of(SymbolicRefs.BSM_INVOKE)
+        return Optional.of(DynamicConstantRef.<MethodType>of(SymbolicRefs.BSM_INVOKE, SymbolicRefs.CR_MethodTypeRef)
                                    .withArgs(SymbolicRefs.MHR_METHODTYPEREF_FACTORY, descriptorString()));
     }
 
--- a/src/java.base/share/classes/java/lang/sym/VarHandleRef.java	Thu Jan 25 22:07:34 2018 +0100
+++ b/src/java.base/share/classes/java/lang/sym/VarHandleRef.java	Fri Jan 26 15:47:40 2018 -0500
@@ -198,7 +198,7 @@
                 return Optional.empty();
             args.add(varTypeRefRef.get());
         }
-        return Optional.of(DynamicConstantRef.<VarHandle>of(SymbolicRefs.BSM_INVOKE)
+        return Optional.of(DynamicConstantRef.<VarHandle>of(SymbolicRefs.BSM_INVOKE, name(), SymbolicRefs.CR_VarHandleRef)
                                    .withArgs(args.toArray(EMPTY_ARGS)));
     }