Class InvokeInstruction

    • Constructor Detail

      • InvokeInstruction

        InvokeInstruction()
        Empty constructor needed for Instruction.readInstruction. Not to be used otherwise.
      • InvokeInstruction

        protected InvokeInstruction​(short opcode,
                                    int index)
        Constructs an InvokeInstruction.
        Parameters:
        opcode - the opcode.
        index - to constant pool.
    • Method Detail

      • consumeStack

        public int consumeStack​(ConstantPoolGen cpg)
        Also works for instructions whose stack effect depends on the constant pool entry they reference.
        Specified by:
        consumeStack in interface StackConsumer
        Overrides:
        consumeStack in class Instruction
        Parameters:
        cpg - the constant pool generator.
        Returns:
        Number of words consumed from stack by this instruction.
      • getArgumentTypes

        public Type[] getArgumentTypes​(ConstantPoolGen cpg)
        Gets the argument types of referenced method.
        Parameters:
        cpg - the constant pool generator.
        Returns:
        argument types of referenced method.
      • getClassName

        public java.lang.String getClassName​(ConstantPoolGen cpg)
        This overrides the deprecated version as we know here that the referenced class may legally be an array.
        Overrides:
        getClassName in class FieldOrMethod
        Parameters:
        cpg - the constant pool generator.
        Returns:
        name of the referenced class/interface.
        Throws:
        java.lang.IllegalArgumentException - if the referenced class is an array (this should not happen)
      • getMethodName

        public java.lang.String getMethodName​(ConstantPoolGen cpg)
        Gets the name of referenced method.
        Parameters:
        cpg - the constant pool generator.
        Returns:
        name of referenced method.
      • getReturnType

        public Type getReturnType​(ConstantPoolGen cpg)
        Gets the return type of referenced method.
        Parameters:
        cpg - the constant pool generator.
        Returns:
        return type of referenced method.
      • produceStack

        public int produceStack​(ConstantPoolGen cpg)
        Also works for instructions whose stack effect depends on the constant pool entry they reference.
        Specified by:
        produceStack in interface StackProducer
        Overrides:
        produceStack in class Instruction
        Parameters:
        cpg - the constant pool generator.
        Returns:
        Number of words produced onto stack by this instruction.
      • toString

        public java.lang.String toString​(ConstantPool cp)
        Description copied from class: Instruction
        Gets the mnemonic for instruction with symbolic references resolved.
        Overrides:
        toString in class CPInstruction
        Parameters:
        cp - the constant pool.
        Returns:
        mnemonic for instruction with symbolic references resolved.