Modifier and Type | Field and Description |
---|---|
Throwable |
cause
Contains the
Throwable that could be thrown if the phase was executed. |
String |
reason
Describes why a phase cannot be applied at this point of the compilation.
|
Constructor and Description |
---|
NotApplicable(String reason) |
NotApplicable(String reason,
Throwable cause) |
NotApplicable(Throwable cause) |
Modifier and Type | Method and Description |
---|---|
static Optional<BasePhase.NotApplicable> |
canOnlyApplyOnce(BasePhase<?> phase,
GraphState.StageFlag flag,
GraphState graphState)
Constructs an
Optional from a BasePhase.NotApplicable stating the given stage was
already applied and cannot be applied a second time if the stage is already applied to
the GraphState . |
static Optional<BasePhase.NotApplicable> |
combineConstraints(Optional<BasePhase.NotApplicable>... constraints)
Combines the given constraints.
|
static Optional<BasePhase.NotApplicable> |
mustRunAfter(BasePhase<?> phase,
GraphState.StageFlag flag,
GraphState graphState)
Constructs an
Optional from a BasePhase.NotApplicable stating the given phase must
run after the given GraphState.StageFlag if the GraphState is before that stage. |
static Optional<BasePhase.NotApplicable> |
mustRunBefore(BasePhase<?> phase,
GraphState.StageFlag flag,
GraphState graphState)
Constructs an
Optional from a BasePhase.NotApplicable stating the given phase must
run before the given GraphState.StageFlag if the GraphState is already after that
stage. |
static Optional<BasePhase.NotApplicable> |
mustWeakenFrameStateVerification(BasePhase<?> phase,
GraphState.FrameStateVerification flag,
GraphState graphState)
Constructs an
Optional from a BasePhase.NotApplicable stating the
GraphState.FrameStateVerification cannot be weakened if the
frame state verification has already
been weakened past the desired stage. |
static Optional<BasePhase.NotApplicable> |
notApplicableIf(boolean condition,
Optional<BasePhase.NotApplicable> notApplicable) |
String |
toString() |
static Optional<BasePhase.NotApplicable> |
undefinedSpeculationLog(BasePhase<?> phase,
GraphState graphState)
Constructs an
Optional from a BasePhase.NotApplicable stating the given phase needs
a defined SpeculationLog if the given GraphState does not have one. |
public final String reason
public NotApplicable(String reason)
public NotApplicable(Throwable cause)
public static Optional<BasePhase.NotApplicable> notApplicableIf(boolean condition, Optional<BasePhase.NotApplicable> notApplicable)
Optional.of(T)
BasePhase.NotApplicable
if the condition is
true
. Otherwise, returns BasePhase.ALWAYS_APPLICABLE
.public static Optional<BasePhase.NotApplicable> mustRunBefore(BasePhase<?> phase, GraphState.StageFlag flag, GraphState graphState)
Optional
from a BasePhase.NotApplicable
stating the given phase must
run before the given GraphState.StageFlag
if the GraphState
is already after that
stage. Otherwise, returns BasePhase.ALWAYS_APPLICABLE
. This can be used to create a return
value for BasePhase.canApply(org.graalvm.compiler.nodes.GraphState)
.public static Optional<BasePhase.NotApplicable> mustRunAfter(BasePhase<?> phase, GraphState.StageFlag flag, GraphState graphState)
Optional
from a BasePhase.NotApplicable
stating the given phase must
run after the given GraphState.StageFlag
if the GraphState
is before that stage.
Otherwise, returns BasePhase.ALWAYS_APPLICABLE
. This can be used to create a return value
for BasePhase.canApply(org.graalvm.compiler.nodes.GraphState)
.public static Optional<BasePhase.NotApplicable> canOnlyApplyOnce(BasePhase<?> phase, GraphState.StageFlag flag, GraphState graphState)
Optional
from a BasePhase.NotApplicable
stating the given stage was
already applied and cannot be applied a second time if the stage is already applied to
the GraphState
. Otherwise, returns BasePhase.ALWAYS_APPLICABLE
. This can be used
to create a return value for BasePhase.canApply(org.graalvm.compiler.nodes.GraphState)
.public static Optional<BasePhase.NotApplicable> mustWeakenFrameStateVerification(BasePhase<?> phase, GraphState.FrameStateVerification flag, GraphState graphState)
Optional
from a BasePhase.NotApplicable
stating the
GraphState.FrameStateVerification
cannot be weakened if the
frame state verification has already
been weakened past the desired stage. Otherwise, returns BasePhase.ALWAYS_APPLICABLE
. This
can be used to create a return value for BasePhase.canApply(org.graalvm.compiler.nodes.GraphState)
.public static Optional<BasePhase.NotApplicable> undefinedSpeculationLog(BasePhase<?> phase, GraphState graphState)
Optional
from a BasePhase.NotApplicable
stating the given phase needs
a defined SpeculationLog
if the given GraphState
does not have one.
Otherwise, returns BasePhase.ALWAYS_APPLICABLE
. This can be used to create a return value
for BasePhase.canApply(org.graalvm.compiler.nodes.GraphState)
.@SafeVarargs public static Optional<BasePhase.NotApplicable> combineConstraints(Optional<BasePhase.NotApplicable>... constraints)
Optional.empty()
if all the constraints are empty,
Optional#of(NotApplicable)
containing all the constraints that make this
phase not applicable otherwise.