Package iota
Class NHirInstruction
java.lang.Object
iota.NHirInstruction
- Direct Known Subclasses:
NHirArithmetic
,NHirCall
,NHirIConst
,NHirJump
,NHirLoadParam
,NHirPhiFunction
,NHirReturn
An abstract high-level intermediate representation (HIR) of a JVM instruction.
-
Field Summary
FieldsModifier and TypeFieldDescriptionEnclosing basic block.Maps HIR mnemonic to the corresponding LIR mnemonic.int
Instruction id.Maps JVM opcode to the corresponding HIR mnemonic.The last of the corresponding LIR instructions.Instruction mnemonic.Instruction type ("I" for int and boolean, "V" for void, and "" for no type). -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
NHirInstruction
(NBasicBlock block, int id, String mnemonic) Constructs an NHirInstruction object.protected
NHirInstruction
(NBasicBlock block, int id, String mnemonic, String type) Constructs an NHirInstruction object. -
Method Summary
-
Field Details
-
jvm2Hir
Maps JVM opcode to the corresponding HIR mnemonic. For example, maps IMUL to "*". -
hir2lir
Maps HIR mnemonic to the corresponding LIR mnemonic. For example, maps "*" to "mul". -
block
Enclosing basic block. -
id
public int idInstruction id. -
mnemonic
Instruction mnemonic. -
type
Instruction type ("I" for int and boolean, "V" for void, and "" for no type). -
lir
The last of the corresponding LIR instructions.
-
-
Constructor Details
-
NHirInstruction
Constructs an NHirInstruction object.- Parameters:
block
- enclosing basic block.id
- instruction id.mnemonic
- instruction mnemonic.
-
NHirInstruction
Constructs an NHirInstruction object.- Parameters:
block
- enclosing basic block.id
- instruction id.mnemonic
- instruction mnemonic.type
- instruction type.
-
-
Method Details
-
id
Returns the id of this instruction as a string.- Returns:
- the id of this instruction as a string.
-
toLir
Converts and returns a low-level representation (LIR) of this instruction.- Returns:
- the LIR instruction corresponding to this instruction.
-
toString
Returns a string representation of this instruction.
-