--- old/src/java.base/share/classes/java/lang/constant/ConstantDescs.java 2018-09-28 11:54:05.000000000 -0700 +++ new/src/java.base/share/classes/java/lang/constant/ConstantDescs.java 2018-09-28 11:54:04.000000000 -0700 @@ -58,6 +58,22 @@ */ public static final String DEFAULT_NAME = "_"; + /** Invocation name to use with a no-metadata expression mode bootstrap method. + * The effect of resolving a dynamic constant with this name is to call + * the bootstrap method on the arguments, but not on the lookup, name, or type. + * The arguments are resolved. + */ + public static final String INVOKE_NAME = "invoke"; + + /** Invocation name to use with a no-metadata expression mode bootstrap method. + * The effect of resolving a dynamic constant with this name is to call + * the bootstrap method on the arguments, but not on the lookup, name, or type. + * In addition, formal parameters which are of a supertype of {@link ConstantDesc} + * are not resolved, but are passed as unresolved {@link ConstantDesc} values + * derived directly from the constant pool. + */ + public static final String SYMBOLIC_NAME = "symbolic"; + // Don't change the order of these declarations! /** {@link ClassDesc} representing {@link Object} */ @@ -249,18 +265,10 @@ DEFAULT_NAME, ConstantDescs.CR_Object); // Used by XxxDesc classes, but need to be here to avoid bootstrap cycles - static final DirectMethodHandleDesc MHR_METHODTYPEDESC_FACTORY - = MethodHandleDesc.of(DirectMethodHandleDesc.Kind.STATIC, CR_MethodTypeDesc, "ofDescriptor", - CR_MethodTypeDesc, CR_String); - static final DirectMethodHandleDesc MHR_CLASSDESC_FACTORY = MethodHandleDesc.of(DirectMethodHandleDesc.Kind.STATIC, CR_ClassDesc, "ofDescriptor", CR_ClassDesc, CR_String); - static final DirectMethodHandleDesc MHR_METHODHANDLEDESC_FACTORY - = MethodHandleDesc.of(DirectMethodHandleDesc.Kind.STATIC, CR_DirectMethodHandleDesc, "ofDescriptor", - CR_DirectMethodHandleDesc, CR_String, CR_String, CR_String, CR_String); - static final DirectMethodHandleDesc MHR_METHODHANDLE_ASTYPE = MethodHandleDesc.of(DirectMethodHandleDesc.Kind.VIRTUAL, CR_MethodHandle, "asType", CR_MethodHandle, CR_MethodType); @@ -269,13 +277,9 @@ = MethodHandleDesc.of(DirectMethodHandleDesc.Kind.VIRTUAL, CR_MethodHandleDesc, "asType", CR_MethodHandleDesc, CR_MethodTypeDesc); - static final DirectMethodHandleDesc MHR_DYNAMICCONSTANTDESC_FACTORY - = MethodHandleDesc.of(DirectMethodHandleDesc.Kind.STATIC, CR_DynamicConstantDesc, "of", - CR_DynamicConstantDesc, CR_DirectMethodHandleDesc, CR_ConstantDesc.arrayType()); - - static final DirectMethodHandleDesc MHR_DYNAMICCONSTANTDESC_NAMED_FACTORY - = MethodHandleDesc.of(DirectMethodHandleDesc.Kind.STATIC, CR_DynamicConstantDesc, "ofNamed", - CR_DynamicConstantDesc, CR_DirectMethodHandleDesc, CR_String, CR_String, CR_ConstantDesc.arrayType()); + static final DirectMethodHandleDesc MHR_CONSTANTDESC_IDENTITY + = MethodHandleDesc.of(DirectMethodHandleDesc.Kind.STATIC, CR_ConstantBootstraps, "constantDesc", + CR_ConstantDesc, CR_ConstantDesc); /** {@link MethodHandleDesc} representing {@link EnumDesc#ofDescriptor(String, String)} */ public static final DirectMethodHandleDesc MHR_ENUMDESC_FACTORY @@ -296,17 +300,6 @@ = MethodHandleDesc.of(DirectMethodHandleDesc.Kind.STATIC, CR_VarHandleDesc, "ofArray", CR_VarHandleDesc, CR_ClassDesc); - static final DirectMethodHandleDesc BSM_METHODHANDLEDESC - = ConstantDescs.ofConstantBootstrap(CR_DirectMethodHandleDesc, - "constantBootstrap", CR_DirectMethodHandleDesc, - CR_String, CR_String, CR_String, CR_String); - - static final DirectMethodHandleDesc BSM_DYNAMICCONSTANTDESC - = ConstantDescs.ofConstantBootstrap(CR_DynamicConstantDesc, - "constantBootstrap", - CR_DynamicConstantDesc, - CR_DirectMethodHandleDesc, CR_String, CR_String, CR_ConstantDesc.arrayType()); - /** * Return a {@link MethodHandleDesc} corresponding to a bootstrap method for * an {@code invokedynamic} callsite, which is a static method whose leading