Package jminusminus

Class NLIRMove


class NLIRMove extends NLIRInstruction
LIR move instruction.
  • Constructor Details

    • NLIRMove

      public NLIRMove(NBasicBlock block, int id, NLIRInstruction from, NLIRInstruction to)
      Constructs an NLIRMove object.
      Parameters:
      block - enclosing block.
      id - identifier of the instruction.
      from - LIR to move from.
      to - LIR to move to.
    • NLIRMove

      public NLIRMove(NBasicBlock block, int id, NRegister from, NRegister to)
      Constructs an NLIRMove object.
      Parameters:
      block - enclosing block.
      id - identifier of the instruction.
      from - register (virtual or physical) to move from.
      to - register (virtual or physical) to move to.
  • Method Details

    • allocatePhysicalRegisters

      public void allocatePhysicalRegisters()
      Replace references to virtual registers in this LIR instruction with references to physical registers.
      Overrides:
      allocatePhysicalRegisters in class NLIRInstruction
    • toSpim

      public void toSpim(PrintWriter out)
      Translates this LIR instruction into SPIM and writes it out to the specified output stream.
      Overrides:
      toSpim in class NLIRInstruction
      Parameters:
      out - output stream for SPIM code.
    • toString

      public String toString()
      Returns a string representation of this instruction.
      Overrides:
      toString in class NLIRInstruction
      Returns:
      a string representation of this instruction.