public abstract class BasePhase<C> extends Object implements PhaseSizeContract
SingleRunSubphase. There will be one global instance for each compiler phase that is
shared for all compilations. VM-, target- and compilation-specific data can be passed with a
context object.| Modifier and Type | Class and Description |
|---|---|
static interface |
BasePhase.ApplyScope
Similar to a
DebugCloseable but the BasePhase.ApplyScope.close(java.lang.Throwable) operation gets a Throwable
argument indicating whether the call to BasePhase.run(org.graalvm.compiler.nodes.StructuredGraph, C) completed normally or with an exception. |
static class |
BasePhase.BasePhaseStatistics |
static class |
BasePhase.PhaseOptions |
static interface |
BasePhase.SharedGlobalPhaseState
Marker interface for fields inside phase classes that capture some state that is shared
across all compilations.
|
| Modifier | Constructor and Description |
|---|---|
protected |
BasePhase() |
| Modifier and Type | Method and Description |
|---|---|
void |
apply(StructuredGraph graph,
C context) |
void |
apply(StructuredGraph graph,
C context,
boolean dumpGraph) |
protected BasePhase.ApplyScope |
applyScope(StructuredGraph graph,
C context)
Return an
BasePhase.ApplyScope which will surround all the work performed by the call to
BasePhase.run(org.graalvm.compiler.nodes.StructuredGraph, C) in BasePhase.apply(StructuredGraph, Object, boolean). |
float |
codeSizeIncrease()
Returns a factor
>=1 that determines what the final code size in terms of the sum of
the node code sizes NodeSize of all nodes is. |
String |
contractorName() |
boolean |
equals(Object obj) |
CharSequence |
getName() |
int |
hashCode()
Hashing a phase is used to implement and test phase plan serialization.
|
protected abstract void |
run(StructuredGraph graph,
C context) |
protected boolean |
shouldDumpAfterAtBasicLevel() |
protected boolean |
shouldDumpBeforeAtBasicLevel() |
clone, getClass, notify, notifyAll, toString, wait, wait, waitcheckContractpublic final void apply(StructuredGraph graph, C context)
protected boolean shouldDumpBeforeAtBasicLevel()
protected boolean shouldDumpAfterAtBasicLevel()
protected BasePhase.ApplyScope applyScope(StructuredGraph graph, C context)
BasePhase.ApplyScope which will surround all the work performed by the call to
BasePhase.run(org.graalvm.compiler.nodes.StructuredGraph, C) in BasePhase.apply(StructuredGraph, Object, boolean). This allows subclaseses to
inject work which will performed before and after the application of this phase.public final void apply(StructuredGraph graph, C context, boolean dumpGraph)
public CharSequence getName()
protected abstract void run(StructuredGraph graph, C context)
public String contractorName()
contractorName in interface PhaseSizeContractpublic float codeSizeIncrease()
PhaseSizeContract>=1 that determines what the final code size in terms of the sum of
the node code sizes NodeSize of all nodes is.codeSizeIncrease in interface PhaseSizeContractpublic int hashCode()
PhaseInfo annotation is introduced (c.f. NodeInfo). The hash code returned
needs to be stable across VM executions.public boolean equals(Object obj)
equals in class ObjectBasePhase.hashCode()