public class ConditionalEliminationPhase.ConditionalElimination extends SinglePassNodeIterator<ConditionalEliminationPhase.State>
Modifier and Type | Field and Description |
---|---|
private LogicNode |
falseConstant |
private LogicNode |
trueConstant |
state
Constructor and Description |
---|
ConditionalElimination(StartNode start,
ConditionalEliminationPhase.State initialState) |
Modifier and Type | Method and Description |
---|---|
private boolean |
assertImpliedGuard(Set<GuardNode> provers) |
private ConditionalEliminationPhase.GuardedStamp |
computeGuardedStamp(GuardNode guard) |
private void |
eliminateGuard(GuardNode guard,
GuardingNode anchor)
Replace
guard with anchor . |
private boolean |
eliminateTrivialGuardOrRegisterStamp(GuardNode guard) |
private <T extends ValueNode> |
evaluateCondition(LogicNode condition,
T trueValue,
T falseValue)
Determines if, at the current point in the control flow, the condition is known to be
true, false or unknown.
|
void |
finished()
The lifecycle that single-pass node iterators go through is described in
SinglePassNodeIterator.apply() |
protected void |
node(FixedNode node) |
private void |
processAbstractBegin(AbstractBeginNode begin) |
private void |
processAbstractEnd(AbstractEndNode endNode) |
private void |
processCheckCast(CheckCastNode checkCast) |
private void |
processConditionAnchor(ConditionAnchorNode conditionAnchorNode) |
private void |
processFixedGuard(FixedGuardNode guard) |
private void |
processIf(IfNode ifNode) |
private void |
processInvoke(Invoke invoke) |
private void |
registerCondition(boolean isTrue,
LogicNode condition,
GuardingNode anchor) |
private void |
registerConditionalStamp(GuardNode guard) |
private void |
registerControlSplitInfo(Node pred,
AbstractBeginNode begin) |
private GuardingNode |
searchAnchor(ValueNode value,
ResolvedJavaType type) |
private boolean |
testImpliedGuard(GuardNode guard)
See if a conditional type constraint can prove this guard.
|
private boolean |
tryReplaceWithExistingGuard(GuardNode guard) |
private void |
trySimplify(IfNode ifNode,
LogicNode compare,
LogicNode replacement,
GuardingNode replacementAnchor,
AbstractBeginNode survivingSuccessor) |
apply, controlSplit, end, invoke, loopBegin, loopEnd, merge
private final LogicNode trueConstant
private final LogicNode falseConstant
public ConditionalElimination(StartNode start, ConditionalEliminationPhase.State initialState)
public void finished()
SinglePassNodeIterator
SinglePassNodeIterator.apply()
When overriding this method don't forget to invoke this implementation, otherwise the assertions will be skipped.
finished
in class SinglePassNodeIterator<ConditionalEliminationPhase.State>
private void registerCondition(boolean isTrue, LogicNode condition, GuardingNode anchor)
private void registerControlSplitInfo(Node pred, AbstractBeginNode begin)
private ConditionalEliminationPhase.GuardedStamp computeGuardedStamp(GuardNode guard)
private boolean eliminateTrivialGuardOrRegisterStamp(GuardNode guard)
private void eliminateGuard(GuardNode guard, GuardingNode anchor)
guard
with anchor
.guard
- The guard to eliminate.anchor
- Node to replace the guard.private boolean testImpliedGuard(GuardNode guard)
guard
- private boolean tryReplaceWithExistingGuard(GuardNode guard)
private void registerConditionalStamp(GuardNode guard)
private <T extends ValueNode> T evaluateCondition(LogicNode condition, T trueValue, T falseValue)
protected void node(FixedNode node)
node
in class SinglePassNodeIterator<ConditionalEliminationPhase.State>
private void trySimplify(IfNode ifNode, LogicNode compare, LogicNode replacement, GuardingNode replacementAnchor, AbstractBeginNode survivingSuccessor)
private void processInvoke(Invoke invoke)
private void processAbstractEnd(AbstractEndNode endNode)
private void processConditionAnchor(ConditionAnchorNode conditionAnchorNode)
private void processCheckCast(CheckCastNode checkCast)
private void processFixedGuard(FixedGuardNode guard)
private void processAbstractBegin(AbstractBeginNode begin)
private boolean assertImpliedGuard(Set<GuardNode> provers)
private GuardingNode searchAnchor(ValueNode value, ResolvedJavaType type)