Class LLoadInstruction

    • Constructor Detail

      • LLoadInstruction

        public LLoadInstruction​(int opcode,
                                int offset,
                                int varIndex)
        Constructs an LLoadInstruction.
        Parameters:
        opcode - The opcode of the instruction.
        offset - The bytecode offset of the instruction.
        varIndex - The index of the local variable to load.
    • Method Detail

      • write

        public void write​(DataOutputStream dos)
                   throws IOException
        Writes the LLOAD opcode and its operand 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 (pushes a long, which occupies two stack slots).
      • 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 variable index of the instruction.