Package jminusminus

Class NLIRConditionalJump

java.lang.Object
jminusminus.NLIRInstruction
jminusminus.NLIRConditionalJump

class NLIRConditionalJump extends NLIRInstruction
LIR instruction representing an conditional jump instructions in JVM.
  • Constructor Details

    • NLIRConditionalJump

      public NLIRConditionalJump(NBasicBlock block, int id, NLIRInstruction lhs, NLIRInstruction rhs, int opcode, NBasicBlock onTrueDestination, NBasicBlock onFalseDestination)
      Constructs an NLIRConditionalJump object.
      Parameters:
      block - enclosing block.
      id - identifier of the instruction.
      lhs - lhs LIR.
      rhs - rhs LIR.
      opcode - opcode in the test.
      onTrueDestination - block to jump to on true.
      onFalseDestination - block to jump to on false.
  • 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.