Class FConstInstruction


  • public class FConstInstruction
    extends Instruction
    Represents the JVM FCONST_0, FCONST_1, and FCONST_2 instructions.
    • Constructor Detail

      • FConstInstruction

        public FConstInstruction​(int opcode,
                                 int offset,
                                 float value)
        Constructs an FConstInstruction.
        Parameters:
        opcode - The opcode of the instruction.
        offset - The bytecode offset of the instruction.
        value - The float constant value.
    • 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 (pushes a float).
      • 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).
      • getValue

        public float getValue()
        Returns the constant value pushed onto the stack.
        Returns:
        The float constant.
      • toString

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