|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jikesrvm.compilers.opt.driver.CompilerPhase org.jikesrvm.compilers.opt.LocalCastOptimization
public final class LocalCastOptimization
Perform simple peephole optimizations to reduce the overhead of checking casts. This code was inspired by some special cases in handling checkcast in HIR2LIR, but the actual code is all different.
There are currently the following optimizations:
Field Summary |
---|
Fields inherited from class org.jikesrvm.compilers.opt.driver.CompilerPhase |
---|
container |
Constructor Summary | |
---|---|
LocalCastOptimization()
|
Method Summary | |
---|---|
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. |
Methods inherited from class org.jikesrvm.compilers.opt.driver.CompilerPhase |
---|
dumpIR, dumpIR, getClassConstructor, getCompilerPhaseConstructor, getCompilerPhaseConstructor, performPhase, printingEnabled, setContainer, shouldPerform, verify |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LocalCastOptimization()
Method Detail |
---|
public String getName()
getName
in class CompilerPhase
public void reportAdditionalStats()
CompilerPhase
reportAdditionalStats
in class CompilerPhase
public CompilerPhase newExecution(IR ir)
newExecution
in class CompilerPhase
ir
- not used
public void perform(IR ir)
perform
in class CompilerPhase
ir
- the IR to transformprivate boolean invertNullAndTypeChecks(Instruction s)
s
- the potential checkcast instruction
private boolean pushTypeCheckBelowIf(Instruction s, IR ir)
s
- the potential typecheck instructionir
- the governing IR
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |