Module java.base

Class DynamicCallSiteDesc

    • Method Detail

      • of

        public static DynamicCallSiteDesc of​(DirectMethodHandleDesc bootstrapMethod,
                                             String invocationName,
                                             MethodTypeDesc invocationType,
                                             ConstantDesc... bootstrapArgs)
        Creates a nominal descriptor for an invokedynamic call site.
        Parameters:
        bootstrapMethod - a DirectMethodHandleDesc describing the bootstrap method for the invokedynamic
        invocationName - The unqualified name that would appear in the NameAndType operand of the invokedynamic
        invocationType - a MethodTypeDesc describing the invocation type that would appear in the NameAndType operand of the invokedynamic
        bootstrapArgs - ConstantDescs describing the static arguments to the bootstrap, that would appear in the BootstrapMethods attribute
        Returns:
        the nominal descriptor
        Throws:
        NullPointerException - if any parameter is null
        IllegalArgumentException - if the invocation name has the incorrect format
        See The Java™ Virtual Machine Specification:
        4.2.2 Unqualified Names
      • of

        public static DynamicCallSiteDesc of​(DirectMethodHandleDesc bootstrapMethod,
                                             String invocationName,
                                             MethodTypeDesc invocationType)
        Creates a nominal descriptor for an invokedynamic call site whose bootstrap method has no static arguments.
        Parameters:
        bootstrapMethod - The bootstrap method for the invokedynamic
        invocationName - The invocationName that would appear in the NameAndType operand of the invokedynamic
        invocationType - The invocation invocationType that would appear in the NameAndType operand of the invokedynamic
        Returns:
        the nominal descriptor
        Throws:
        NullPointerException - if any parameter is null
        IllegalArgumentException - if the invocation name has the incorrect format
      • withArgs

        public DynamicCallSiteDesc withArgs​(ConstantDesc... bootstrapArgs)
        Returns a nominal descriptor for an invokedynamic call site whose bootstrap method, name, and invocation type are the same as this one, but with the specified bootstrap arguments.
        Parameters:
        bootstrapArgs - ConstantDescs describing the static arguments to the bootstrap, that would appear in the BootstrapMethods attribute
        Returns:
        the nominal descriptor
        Throws:
        NullPointerException - if any parameter is null
      • withNameAndType

        public DynamicCallSiteDesc withNameAndType​(String invocationName,
                                                   MethodTypeDesc invocationType)
        Returns a nominal descriptor for an invokedynamic call site whose bootstrap and bootstrap arguments are the same as this one, but with the specified invocationName and invocation invocationType
        Parameters:
        invocationName - The unqualified name that would appear in the NameAndType operand of the invokedynamic
        invocationType - a MethodTypeDesc describing the invocation type that would appear in the NameAndType operand of the invokedynamic
        Returns:
        the nominal descriptor
        Throws:
        NullPointerException - if any parameter is null
        IllegalArgumentException - if the invocation name has the incorrect format
        See The Java™ Virtual Machine Specification:
        4.2.2 Unqualified Names
      • invocationName

        public String invocationName()
        Returns the invocation name that would appear in the NameAndType operand of the invokedynamic.
        Returns:
        the invocation name
      • invocationType

        public MethodTypeDesc invocationType()
        Returns a MethodTypeDesc describing the invocation type that would appear in the NameAndType operand of the invokedynamic.
        Returns:
        the invocation type
      • bootstrapMethod

        public MethodHandleDesc bootstrapMethod()
        Returns a MethodHandleDesc describing the bootstrap method for the invokedynamic.
        Returns:
        the bootstrap method for the invokedynamic
      • bootstrapArgs

        public ConstantDesc[] bootstrapArgs()
        Returns ConstantDescs describing the bootstrap arguments for the invokedynamic. The returned array is always non-null. A zero length array is returned if this DynamicCallSiteDesc has no bootstrap arguments.
        Returns:
        the bootstrap arguments for the invokedynamic
      • equals

        public final boolean equals​(Object o)
        Compares the specified object with this descriptor for equality. Returns true if and only if the specified object is also a DynamicCallSiteDesc, and both descriptors have equal bootstrap methods, bootstrap argument lists, invocation name, and invocation type.
        Overrides:
        equals in class Object
        Parameters:
        o - the DynamicCallSiteDesc to compare to this DynamicCallSiteDesc
        Returns:
        true if the specified DynamicCallSiteDesc is equals to this DynamicCallSiteDesc.
        See Also:
        Object.hashCode(), HashMap
      • toString

        public String toString()
        Returns a compact textual description of this call site description, including the bootstrap method, the invocation name and type, and the static bootstrap arguments.
        Overrides:
        toString in class Object
        Returns:
        A compact textual description of this call site descriptor