Class InvokeInstruction


  • public class InvokeInstruction
    extends IRInstruction
    A method invocation of any dispatch kind, including invokedynamic with bootstrap info.
    • Constructor Detail

      • InvokeInstruction

        public InvokeInstruction​(SSAValue result,
                                 InvokeType invokeType,
                                 String owner,
                                 String name,
                                 String descriptor,
                                 List<Value> arguments)
        Creates a value-producing invocation with no constant pool index or bootstrap method.
        Parameters:
        result - the SSA value receiving the return value
        invokeType - the dispatch kind
        owner - the internal name of the declaring class
        name - the method name
        descriptor - the method descriptor
        arguments - the call arguments, including the receiver for instance calls
      • InvokeInstruction

        public InvokeInstruction​(SSAValue result,
                                 InvokeType invokeType,
                                 String owner,
                                 String name,
                                 String descriptor,
                                 List<Value> arguments,
                                 int originalCpIndex)
        Creates a value-producing invocation with no bootstrap method.
        Parameters:
        result - the SSA value receiving the return value
        invokeType - the dispatch kind
        owner - the internal name of the declaring class
        name - the method name
        descriptor - the method descriptor
        arguments - the call arguments, including the receiver for instance calls
        originalCpIndex - the constant pool index of the original call site, or 0
      • InvokeInstruction

        public InvokeInstruction​(SSAValue result,
                                 InvokeType invokeType,
                                 String owner,
                                 String name,
                                 String descriptor,
                                 List<Value> arguments,
                                 int originalCpIndex,
                                 BootstrapMethodInfo bootstrapInfo)
        Creates a value-producing invocation and registers uses of its SSA arguments.
        Parameters:
        result - the SSA value receiving the return value
        invokeType - the dispatch kind
        owner - the internal name of the declaring class
        name - the method name
        descriptor - the method descriptor
        arguments - the call arguments, including the receiver for instance calls
        originalCpIndex - the constant pool index of the original call site, or 0
        bootstrapInfo - the bootstrap method for invokedynamic, or null
      • InvokeInstruction

        public InvokeInstruction​(InvokeType invokeType,
                                 String owner,
                                 String name,
                                 String descriptor,
                                 List<Value> arguments)
        Creates a void invocation with no constant pool index or bootstrap method.
        Parameters:
        invokeType - the dispatch kind
        owner - the internal name of the declaring class
        name - the method name
        descriptor - the method descriptor
        arguments - the call arguments, including the receiver for instance calls
      • InvokeInstruction

        public InvokeInstruction​(InvokeType invokeType,
                                 String owner,
                                 String name,
                                 String descriptor,
                                 List<Value> arguments,
                                 int originalCpIndex)
        Creates a void invocation with no bootstrap method.
        Parameters:
        invokeType - the dispatch kind
        owner - the internal name of the declaring class
        name - the method name
        descriptor - the method descriptor
        arguments - the call arguments, including the receiver for instance calls
        originalCpIndex - the constant pool index of the original call site, or 0
      • InvokeInstruction

        public InvokeInstruction​(InvokeType invokeType,
                                 String owner,
                                 String name,
                                 String descriptor,
                                 List<Value> arguments,
                                 int originalCpIndex,
                                 BootstrapMethodInfo bootstrapInfo)
        Creates a void invocation and registers uses of its SSA arguments.
        Parameters:
        invokeType - the dispatch kind
        owner - the internal name of the declaring class
        name - the method name
        descriptor - the method descriptor
        arguments - the call arguments, including the receiver for instance calls
        originalCpIndex - the constant pool index of the original call site, or 0
        bootstrapInfo - the bootstrap method for invokedynamic, or null
    • Method Detail

      • getInvokeType

        public InvokeType getInvokeType()
        Returns:
        the invoke type
      • getOwner

        public String getOwner()
        Returns:
        the owner
      • getName

        public String getName()
        Returns:
        the name
      • getDescriptor

        public String getDescriptor()
        Returns:
        the descriptor
      • getArguments

        public List<Value> getArguments()
        Returns:
        the arguments
      • getOriginalCpIndex

        public int getOriginalCpIndex()
        Returns:
        the original cp index
      • getReceiver

        public Value getReceiver()
        Gets the receiver object for instance method calls.
        Returns:
        the receiver value, or null for static calls
      • getMethodArguments

        public List<Value> getMethodArguments()
        Gets the method arguments excluding the receiver.
        Returns:
        list of method arguments
      • isDynamic

        public boolean isDynamic()
        Checks if this is an invokedynamic instruction.
        Returns:
        true if this is a dynamic invocation
      • hasBootstrapInfo

        public boolean hasBootstrapInfo()
        Checks if this invocation has bootstrap method info available.
        Returns:
        true if bootstrap info is available
      • replaceOperand

        public void replaceOperand​(Value oldValue,
                                   Value newValue)
        Description copied from class: IRInstruction
        Replaces an operand value with a new value.
        Specified by:
        replaceOperand in class IRInstruction
        Parameters:
        oldValue - the value to replace
        newValue - the replacement value
      • accept

        public <T> T accept​(IRVisitor<T> visitor)
        Description copied from class: IRInstruction
        Accepts a visitor for this instruction.
        Specified by:
        accept in class IRInstruction
        Type Parameters:
        T - the return type
        Parameters:
        visitor - the visitor to accept
        Returns:
        the visitor result
      • copyWithNewOperands

        public IRInstruction copyWithNewOperands​(SSAValue newResult,
                                                 List<Value> newOperands)
        Description copied from class: IRInstruction
        Creates a copy of this instruction with new result and operands.
        Overrides:
        copyWithNewOperands in class IRInstruction
        Parameters:
        newResult - the new result value (may be null)
        newOperands - the new operand values
        Returns:
        a copy of this instruction, or null if copying not supported