public class OsrPointConstructor extends CompilerPhase
Modifier and Type | Field and Description |
---|---|
private BranchOptimizations |
branchOpts
Need to run branch optimizations after
|
private static Constructor<CompilerPhase> |
constructor |
private Collection<Instruction> |
osrBarriers |
private LinkedList<Instruction> |
osrPoints |
container
Constructor and Description |
---|
OsrPointConstructor()
Constructor
|
Modifier and Type | Method and Description |
---|---|
private void |
adjustBCIndex(Instruction barrier)
The OsrBarrier instruction is not in IR, so the bc index was not
adjusted in OSR_AdjustBCIndex.
|
private void |
collectOsrPointsAndBarriers(IR ir)
Iterates over all instructions in the IR and builds a list of
OsrPoint instructions and OsrBarrier instructions.
|
private int |
countNonVoidTypes(byte[] typeCodes) |
private void |
fixupCFGForOsr(IR ir)
Splits each OsrPoint, and connects it to the exit point.
|
Constructor<CompilerPhase> |
getClassConstructor()
Get a constructor object for this compiler phase
|
String |
getName() |
private boolean |
isBarrierClean(Instruction barrier)
Determines if the barrier is clean by checking the number of valid operands.
|
void |
perform(IR ir)
Goes through each instruction, reconstruct OsrPoint instructions.
|
private void |
removeOsrBarriers(IR ir) |
private void |
renovateOsrPoints(IR ir)
For each OsrPoint instruction, traces its OsrBarriers created by
inlining. rebuild OsrPoint instruction to hold all necessary
information to recover from inlined activation.
|
boolean |
shouldPerform(OptOptions options)
This method determines if the phase should be run, based on the
Options object it is passed.
|
private void |
verifyNoOsrBarriers(IR ir) |
dumpIR, dumpIR, getCompilerPhaseConstructor, getCompilerPhaseConstructor, newExecution, performPhase, printingEnabled, reportAdditionalStats, setContainer, verify
private static final Constructor<CompilerPhase> constructor
private final BranchOptimizations branchOpts
private Collection<Instruction> osrBarriers
private LinkedList<Instruction> osrPoints
public OsrPointConstructor()
public final boolean shouldPerform(OptOptions options)
CompilerPhase
shouldPerform
in class CompilerPhase
options
- the compiler options for the compilationpublic final String getName()
getName
in class CompilerPhase
public Constructor<CompilerPhase> getClassConstructor()
CompilerPhase
getClassConstructor
in class CompilerPhase
public void perform(IR ir)
perform
in class CompilerPhase
ir
- the IR on which to apply the phaseprivate void collectOsrPointsAndBarriers(IR ir)
ir
- the IRprivate void renovateOsrPoints(IR ir)
ir
- the IRprivate void adjustBCIndex(Instruction barrier)
barrier
- the OSR barrier instructionprivate void removeOsrBarriers(IR ir)
private void verifyNoOsrBarriers(IR ir)
private boolean isBarrierClean(Instruction barrier)
barrier
- the instruction to verifiytrue
if and only if the barrier is cleanprivate int countNonVoidTypes(byte[] typeCodes)
private void fixupCFGForOsr(IR ir)
ir
- the IR