Class InvokeDynamicInfo


  • public final class InvokeDynamicInfo
    extends Object
    An invokedynamic call site: bootstrap method index plus the invoked name and descriptor.
    • Constructor Detail

      • InvokeDynamicInfo

        public InvokeDynamicInfo​(int bootstrapMethodIndex,
                                 String methodName,
                                 String descriptor,
                                 int constantPoolIndex)
        Creates an invokedynamic call site descriptor.
        Parameters:
        bootstrapMethodIndex - index into the BootstrapMethods attribute
        methodName - the invoked name of the call site
        descriptor - the call site's method descriptor
        constantPoolIndex - index of the entry in the constant pool
    • Method Detail

      • getBootstrapMethodIndex

        public int getBootstrapMethodIndex()
        Returns:
        the bootstrap method index
      • getMethodName

        public String getMethodName()
        Returns:
        the method name
      • getDescriptor

        public String getDescriptor()
        Returns:
        the descriptor
      • getConstantPoolIndex

        public int getConstantPoolIndex()
        Returns:
        the constant pool index
      • getParameterSlots

        public int getParameterSlots()
        Counts the local-variable slots consumed by the parameters.
        Returns:
        the total slot count, with long and double counting as two
      • getParameterCount

        public int getParameterCount()
        Counts the parameters declared in the descriptor.
        Returns:
        the number of parameters, or 0 for a missing or malformed descriptor
      • getReturnType

        public String getReturnType()
        Extracts the return type from the descriptor.
        Returns:
        the return type descriptor, or "V" if it cannot be parsed
      • isVoidReturn

        public boolean isVoidReturn()
        Checks whether the call site returns void.
        Returns:
        true if the return type is "V"
      • isLambdaMetafactory

        public boolean isLambdaMetafactory()
        Checks whether the invoked name matches a common functional-interface method, indicating a LambdaMetafactory call site.
        Returns:
        true if the name is a known functional-interface method name
      • isStringConcat

        public boolean isStringConcat()
        Checks whether this is a StringConcatFactory call site.
        Returns:
        true if the invoked name is makeConcat or makeConcatWithConstants