Class WideInstruction

    • Constructor Detail

      • WideInstruction

        public WideInstruction​(int opcode,
                               int offset,
                               Opcode modifiedOpcode,
                               int varIndex)
        Constructs a WideInstruction for variable instructions.
        Parameters:
        opcode - The opcode of the instruction.
        offset - The bytecode offset of the instruction.
        modifiedOpcode - The opcode of the instruction being modified.
        varIndex - The local variable index.
      • WideInstruction

        public WideInstruction​(int opcode,
                               int offset,
                               Opcode modifiedOpcode,
                               int varIndex,
                               int constValue)
        Constructs a WideInstruction for IINC.
        Parameters:
        opcode - The opcode of the instruction.
        offset - The bytecode offset of the instruction.
        modifiedOpcode - The opcode of the instruction being modified.
        varIndex - The local variable index.
        constValue - The constant value for IINC.
    • Method Detail

      • getModifiedOpcode

        public Opcode getModifiedOpcode()
        Returns:
        the modified opcode
      • getConstValue

        public int getConstValue()
        Returns:
        the const value
      • write

        public void write​(DataOutputStream dos)
                   throws IOException
        Writes the WIDE opcode and its operands to the DataOutputStream.
        Specified by:
        write in class Instruction
        Parameters:
        dos - The DataOutputStream to write to.
        Throws:
        IOException - If an I/O error occurs.
      • getStackChange

        public int getStackChange()
        Returns the change in stack size caused by this instruction.
        Specified by:
        getStackChange in class Instruction
        Returns:
        The stack size change based on the modified opcode.
      • getLocalChange

        public int getLocalChange()
        Returns the change in local variables caused by this instruction.
        Specified by:
        getLocalChange in class Instruction
        Returns:
        The local variables size change based on the modified opcode.
      • toString

        public String toString()
        Returns a string representation of the instruction.
        Overrides:
        toString in class Instruction
        Returns:
        The mnemonic and operands of the instruction.