public class ConvertDeoptimizeToGuardPhase extends PostRunCanonicalizationPhase<CoreProviders>
DeoptimizeNode
and replace their
ControlSplitNodes
with FixedGuardNodes
.
This is useful because FixedGuardNodes
will be lowered to GuardNodes
which can later be optimized more aggressively than control-flow constructs.
This is currently only done for branches that start from a IfNode
. If it encounters a
branch starting at an other kind of ControlSplitNode
, it will only bring the
DeoptimizeNode
as close to the ControlSplitNode
as possible.BasePhase.ApplyScope, BasePhase.BasePhaseStatistics, BasePhase.NotApplicable, BasePhase.PhaseOptions, BasePhase.SharedGlobalPhaseState
canonicalizer
ALWAYS_APPLICABLE
Constructor and Description |
---|
ConvertDeoptimizeToGuardPhase(CanonicalizerPhase canonicalizer) |
Modifier and Type | Method and Description |
---|---|
Optional<BasePhase.NotApplicable> |
canApply(GraphState graphState)
Checks if all the preconditions to
BasePhase.apply(StructuredGraph, Object, boolean) the phase
are met. |
protected void |
run(StructuredGraph graph,
CoreProviders context) |
applyScope, updateGraphState
apply, apply, codeSizeIncrease, contractorName, equals, getName, hashCode, mustApply, shouldDumpAfterAtBasicLevel, shouldDumpBeforeAtBasicLevel
clone, getClass, notify, notifyAll, toString, wait, wait, wait
checkContract
public ConvertDeoptimizeToGuardPhase(CanonicalizerPhase canonicalizer)
public Optional<BasePhase.NotApplicable> canApply(GraphState graphState)
BasePhase
BasePhase.apply(StructuredGraph, Object, boolean)
the phase
are met.canApply
in class PostRunCanonicalizationPhase<CoreProviders>
graphState
- represents the state of the StructuredGraph
used for compilation
and contains the required information to determine if a phase can be applied.Optional.empty()
if all the checks pass, Optional#of(NotApplicable)
containing why this phase is not applicable on this graphState
otherwise.protected void run(StructuredGraph graph, CoreProviders context)
run
in class BasePhase<CoreProviders>