public final class MachineCodeOffsets extends Object
Information that is needed at runtime is saved in other classes,
e.g. OptMachineCodeMap
.
Modifier and Type | Field and Description |
---|---|
private Map<Instruction,Integer> |
mcOffsets |
Constructor and Description |
---|
MachineCodeOffsets() |
Modifier and Type | Method and Description |
---|---|
void |
fabricateMachineCodeOffsetForPrologueInstruction(Instruction instr)
Fabricates an offset for prologue instructions in methods that are not
interruptible to deal with an oddity.
|
int |
getMachineCodeOffset(Instruction inst)
Gets the offset into the machine code array (in bytes) that
corresponds to the first byte after this instruction.
|
boolean |
lacksMachineCodeOffset(Instruction inst)
Checks whether a machine code offset is missing for the instruction.
|
void |
setMachineCodeOffset(Instruction inst,
int mcOffset)
This method is only for use by opt assemblers to generate code.
|
private final Map<Instruction,Integer> mcOffsets
MachineCodeOffsets()
public void setMachineCodeOffset(Instruction inst, int mcOffset)
getMachineCodeOffset(Instruction)
.inst
- the instruction whose offset will be setmcOffset
- the offset (in bytes) for the instructionpublic int getMachineCodeOffset(Instruction inst)
This method only returns a valid value after it has been set as a side-effect of a call to generateCode in AssemblerOpt during final assembly.
To get the offset in INSTRUCTIONs you must shift by LG_INSTRUCTION_SIZE.
inst
- the instruction whose offset is queriedOptimizingCompilerException
- when no machine code offset is present for
the instructionpublic boolean lacksMachineCodeOffset(Instruction inst)
inst
- the instruction to checktrue
if the instruction never had a machine code offset
setpublic void fabricateMachineCodeOffsetForPrologueInstruction(Instruction instr)
Note: General clients must not call this method.
instr
- a prologue instruction in a method that's not interruptible