public final class LocalCastOptimization extends CompilerPhase
There are currently the following optimizations:
container| Constructor and Description |
|---|
LocalCastOptimization() |
| Modifier and Type | Method and Description |
|---|---|
String |
getName() |
private boolean |
invertNullAndTypeChecks(Instruction s)
If there's a checkcast followed by a null check, move the checkcast
after the null check, since the null pointer exception must be thrown
anyway.
|
CompilerPhase |
newExecution(IR ir)
Return this instance of this phase.
|
void |
perform(IR ir)
Main routine: perform the transformation.
|
private boolean |
pushTypeCheckBelowIf(Instruction s,
IR ir)
Where legal, move a type check below an if instruction.
|
void |
reportAdditionalStats()
Called when printing a measure compilation report to enable a phase
to report additional phase-specific statistics.
|
dumpIR, dumpIR, getClassConstructor, getCompilerPhaseConstructor, getCompilerPhaseConstructor, performPhase, printingEnabled, setContainer, shouldPerform, verifypublic LocalCastOptimization()
public String getName()
getName in class CompilerPhasepublic void reportAdditionalStats()
CompilerPhasereportAdditionalStats in class CompilerPhasepublic CompilerPhase newExecution(IR ir)
newExecution in class CompilerPhaseir - not usedpublic void perform(IR ir)
perform in class CompilerPhaseir - the IR to transformprivate boolean invertNullAndTypeChecks(Instruction s)
s - the potential checkcast instructionprivate boolean pushTypeCheckBelowIf(Instruction s, IR ir)
s - the potential typecheck instructionir - the governing IRtrue if and only if a type check was moved