Class IConstInstruction


  • public class IConstInstruction
    extends Instruction
    Represents the JVM ICONST_M1, ICONST_0, ICONST_1, ICONST_2, ICONST_3, ICONST_4, and ICONST_5 instructions.
    • Constructor Detail

      • IConstInstruction

        public IConstInstruction​(int opcode,
                                 int offset,
                                 int value)
        Constructs an IConstInstruction.
        Parameters:
        opcode - The opcode of the instruction.
        offset - The bytecode offset of the instruction.
        value - The integer constant value.
    • Method Detail

      • getValue

        public int getValue()
        Returns:
        the value
      • 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 (pushes an int).
      • 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 (none).
      • toString

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