org.jikesrvm.compilers.opt
Class NullCheckCombining
java.lang.Object
org.jikesrvm.compilers.opt.driver.CompilerPhase
org.jikesrvm.compilers.opt.NullCheckCombining
public class NullCheckCombining
- extends CompilerPhase
This module performs two tasks:
- (1) When possible, it folds null checks into the first load/store
that is being guarded by the null check
- (2) It removes all validation registers from the IR
Doing (1) more or less implies either (a) doing (2) or
(b) making large changes to the MIR operator set such that
all load/stores produce validation results.
Although this would be possible, it would not be a trivial change.
So, until we have an urgent need to preserve guard operands all
the way through the MIR, we'll take the easy way out.
Methods inherited from class org.jikesrvm.compilers.opt.driver.CompilerPhase |
dumpIR, dumpIR, getClassConstructor, getCompilerPhaseConstructor, getCompilerPhaseConstructor, performPhase, printingEnabled, reportAdditionalStats, setContainer, shouldPerform, verify |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NullCheckCombining
public NullCheckCombining()
newExecution
public CompilerPhase newExecution(IR ir)
- Return this instance of this phase. This phase contains no
per-compilation instance fields.
- Overrides:
newExecution
in class CompilerPhase
- Parameters:
ir
- not used
- Returns:
- this
getName
public final String getName()
- Specified by:
getName
in class CompilerPhase
- Returns:
- a String which is the name of the phase.
perform
public void perform(IR ir)
- Perform nullcheck combining and validation register removal.
- Specified by:
perform
in class CompilerPhase
- Parameters:
ir
- the IR to transform
isExplicitStore
private boolean isExplicitStore(Instruction s,
Operator op)
isExplicitLoad
private boolean isExplicitLoad(Instruction s,
Operator op)
canFold
private boolean canFold(Instruction s,
Operand activeGuard,
boolean isStore)