Class ConversionInstruction


  • public class ConversionInstruction
    extends Instruction
    Represents the type conversion instructions (I2F, I2D, L2I, L2F, L2D, F2I, F2L, F2D, D2I, D2L, D2F).
    • Constructor Detail

      • ConversionInstruction

        public ConversionInstruction​(int opcode,
                                     int offset)
        Constructs a ConversionInstruction.
        Parameters:
        opcode - The opcode of the instruction.
        offset - The bytecode offset of the instruction.
        Throws:
        IllegalArgumentException - if the opcode is not a conversion opcode
    • Method Detail

      • 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 conversion type.
      • 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 of the conversion instruction.