Package jminusminus
Class NLIRInstruction
java.lang.Object
jminusminus.NLIRInstruction
- Direct Known Subclasses:
NLIRALoad
,NLIRArithmetic
,NLIRAStore
,NLIRConditionalJump
,NLIRGetField
,NLIRGoto
,NLIRIntConstant
,NLIRInvoke
,NLIRLoad
,NLIRLoadLocal
,NLIRMove
,NLIRNewArray
,NLIRPhiFunction
,NLIRPutField
,NLIRReturn
,NLIRStore
,NLIRStringConstant
This abstract base class provides a low-level intermediate representation (LIR) of a JVM
instruction.
-
Field Summary
Modifier and TypeFieldDescriptionThe block containing this instruction.int
Unique identifier of this instruction.protected static String[]
Maps JVM opcode to a string mnemonic for LIR instructions.Registers that store the inputs (if any) of this instruction.Register that stores the result (if any) of this instruction. -
Constructor Summary
ModifierConstructorDescriptionprotected
NLIRInstruction
(NBasicBlock block, int id) Constructs an NLIRInstruction object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Replace references to virtual registers in this LIR instruction with references to physical registers.void
toSpim
(PrintWriter out) Translates this LIR instruction into SPIM and writes it out to the specified output stream.toString()
Returns a string representation of this instruction.
-
Field Details
-
lirMnemonic
Maps JVM opcode to a string mnemonic for LIR instructions. For example, imul is mapped to the "MUL". -
block
The block containing this instruction. -
id
public int idUnique identifier of this instruction. -
reads
Registers that store the inputs (if any) of this instruction. -
write
Register that stores the result (if any) of this instruction.
-
-
Constructor Details
-
NLIRInstruction
Constructs an NLIRInstruction object.- Parameters:
block
- enclosing block.id
- identifier of the instruction.
-
-
Method Details
-
allocatePhysicalRegisters
public void allocatePhysicalRegisters()Replace references to virtual registers in this LIR instruction with references to physical registers. -
toSpim
Translates this LIR instruction into SPIM and writes it out to the specified output stream.- Parameters:
out
- output stream for SPIM code.
-
toString
Returns a string representation of this instruction.
-