public final class StructuredGraph extends Graph implements JavaMethodContext
start node. This
node is the start of the control flow of the graph.| Modifier and Type | Class and Description |
|---|---|
static class |
StructuredGraph.AllowAssumptions
Constants denoting whether or not
Assumptions can be made while processing a graph. |
static class |
StructuredGraph.Builder
Object used to create a
StructuredGraph. |
static class |
StructuredGraph.FrameStateVerification
The different stages of the compilation of a
Graph regarding the status of
FrameState verification of AbstractStateSplit state after. |
static class |
StructuredGraph.FrameStateVerificationFeature
Different node types verified during StructuredGraph.FrameStateVerification.
|
static class |
StructuredGraph.GuardsStage
The different stages of the compilation of a
Graph regarding the status of
GuardNodes, DeoptimizingNodes and FrameStates. |
static class |
StructuredGraph.ScheduleResult |
static class |
StructuredGraph.StageFlag
Different stages of the compilation regarding the status of various graph properties.
|
Graph.DuplicationReplacement, Graph.Mark, Graph.NodeEvent, Graph.NodeEventListener, Graph.NodeEventScope, Graph.Options| Modifier and Type | Field and Description |
|---|---|
static long |
INVALID_GRAPH_ID |
static boolean |
NO_PROFILING_INFO |
static boolean |
USE_PROFILING_INFO |
name, trackNodeSourcePosition, verifyGraphEdges, verifyGraphs| Modifier and Type | Method and Description |
|---|---|
void |
addAfterFixed(FixedWithNextNode node,
FixedNode newNode) |
void |
addBeforeFixed(FixedNode node,
FixedWithNextNode newNode) |
protected void |
afterNodeIdChange(Node node,
Object value) |
protected void |
afterRegister(Node node) |
StructuredGraph.AllowAssumptions |
allowAssumptions()
Returns the AllowAssumptions status for this graph.
|
JavaMethod |
asJavaMethod() |
void |
beforeNodeDuplication(Graph sourceGraph)
This is called before nodes are transferred to
sourceGraph by
NodeClass.addGraphDuplicate(org.graalvm.compiler.graph.Graph, org.graalvm.compiler.graph.Graph, int, java.lang.Iterable<? extends org.graalvm.compiler.graph.Node>, org.graalvm.compiler.graph.Graph.DuplicationReplacement) to allow the transfer of any other state which should
also be transferred. |
protected Object |
beforeNodeIdChange(Node node) |
void |
checkCancellation() |
void |
clearAllStateAfterForTestingOnly()
For use in tests to clear all stateAfter frame states.
|
void |
clearLastSchedule() |
CompilationIdentifier |
compilationId() |
protected boolean |
compress(boolean minimizeSize) |
StructuredGraph |
copy(ResolvedJavaMethod rootMethodForCopy,
OptionValues optionsForCopy,
DebugContext debugForCopy,
boolean trackNodeSourcePositionForCopy) |
protected Graph |
copy(String newName,
Consumer<org.graalvm.collections.UnmodifiableEconomicMap<Node,Node>> duplicationMapCallback,
DebugContext debugForCopy)
Creates a copy of this graph.
|
StructuredGraph |
copy(String newName,
Consumer<org.graalvm.collections.UnmodifiableEconomicMap<Node,Node>> duplicationMapCallback,
DebugContext debugForCopy,
OptionValues options)
Creates a copy of this graph with the new option values.
|
StructuredGraph |
copyWithIdentifier(CompilationIdentifier newCompilationId,
DebugContext debugForCopy) |
void |
disableFrameStateVerification() |
void |
disableUnsafeAccessTracking() |
Assumptions |
getAssumptions()
Gets the object for recording assumptions while constructing of this graph.
|
int |
getBytecodeSize()
Gets the input bytecode size from which this
graph is constructed.
|
NodeSourcePosition |
getCallerContext() |
Cancellable |
getCancellable() |
void |
getDebugProperties(Map<Object,Object> properties)
Add any per graph properties that might be useful for debugging (e.g., to view in the ideal
graph visualizer).
|
int |
getEntryBCI() |
StructuredGraph.FrameStateVerification |
getFrameStateVerification() |
StructuredGraph.GuardsStage |
getGuardsStage() |
InliningLog |
getInliningLog()
Gets the inlining log associated with this graph.
|
Iterable<Invoke> |
getInvokes() |
StructuredGraph.ScheduleResult |
getLastSchedule() |
List<ResolvedJavaMethod> |
getMethods()
Gets an unmodifiable view of the methods that were inlined while constructing this graph.
|
ParameterNode |
getParameter(int index) |
ProfileProvider |
getProfileProvider()
Return the
ProfileProvider in use for the graph. |
ProfilingInfo |
getProfilingInfo()
Gets the profiling info for the root method of this graph.
|
ProfilingInfo |
getProfilingInfo(ResolvedJavaMethod m)
Gets the profiling info for a given method that is or will be part of this graph, taking into
account the
StructuredGraph.getProfileProvider(). |
Stamp |
getReturnStamp() |
SpeculationLog |
getSpeculationLog() |
EnumSet<StructuredGraph.StageFlag> |
getStageFlags() |
long |
graphId() |
boolean |
hasLoops() |
boolean |
hasUnsafeAccess() |
boolean |
hasVirtualizableAllocation() |
boolean |
isAfterStage(StructuredGraph.StageFlag stage) |
boolean |
isBeforeStage(StructuredGraph.StageFlag stage) |
boolean |
isDuringStage(StructuredGraph.StageFlag stage)
Phases may set this flag to indicate that a stage is in progress.
|
boolean |
isOSR() |
boolean |
isStateAfterClearedForTesting() |
boolean |
isSubstitution()
Returns true if this graph is built without parsing the root method or
if the root method is annotated by
Snippet. |
boolean |
isUnsafeAccessTrackingEnabled() |
void |
logInliningTree() |
void |
markUnsafeAccess() |
ResolvedJavaMethod |
method()
Gets the root method from which this graph was built.
|
void |
notifyInliningDecision(Invokable invoke,
boolean positive,
String phase,
org.graalvm.collections.EconomicMap<Node,Node> replacements,
InliningLog calleeLog,
String reason,
Object... args)
Notifies this graph of an inlining decision for
invoke. |
void |
recordAssumptions(StructuredGraph inlineGraph) |
void |
recordMethod(ResolvedJavaMethod method)
Records that
method was used to build this graph. |
void |
reduceDegenerateLoopBegin(LoopBeginNode begin) |
void |
reduceTrivialMerge(AbstractMergeNode merge) |
void |
removeFixed(FixedWithNextNode node)
Unlinks a node from all its control flow neighbors and then removes it from its graph.
|
void |
removeSplit(ControlSplitNode node,
AbstractBeginNode survivingSuccessor) |
void |
removeSplitPropagate(ControlSplitNode node,
AbstractBeginNode survivingSuccessor) |
void |
replaceFixed(FixedWithNextNode node,
Node replacement) |
void |
replaceFixedWithFixed(FixedWithNextNode node,
FixedWithNextNode replacement) |
void |
replaceFixedWithFloating(FixedWithNextNode node,
ValueNode replacement) |
void |
replaceSplit(ControlSplitNode node,
Node replacement,
AbstractBeginNode survivingSuccessor) |
void |
replaceSplitWithFixed(ControlSplitNode node,
FixedWithNextNode replacement,
AbstractBeginNode survivingSuccessor) |
void |
replaceSplitWithFloating(ControlSplitNode node,
FloatingNode replacement,
AbstractBeginNode survivingSuccessor) |
void |
replaceWithExceptionSplit(WithExceptionNode node,
WithExceptionNode replacement) |
void |
setAfterStage(StructuredGraph.StageFlag stage) |
void |
setDuringStage(StructuredGraph.StageFlag stage) |
void |
setGuardsStage(StructuredGraph.GuardsStage guardsStage) |
void |
setLastSchedule(StructuredGraph.ScheduleResult result) |
void |
setStart(StartNode start) |
StartNode |
start() |
String |
toString() |
void |
updateMethods(StructuredGraph other)
Updates the methods used to build this graph with the methods used
to build another graph.
|
void |
weakenFrameStateVerification(StructuredGraph.FrameStateVerification newFrameStateVerification) |
add, addDuplicates, addDuplicates, addOrUnique, addOrUniqueWithInputs, addWithoutUnique, addWithoutUniqueWithInputs, afterDecodingFields, beforeDecodingFields, copy, copy, copy, createIterativeNodeWorkList, createNodeBitMap, createNodeFlood, createNodeMap, createNodeWorkList, currentNodeSourcePosition, findDuplicate, freeze, getCompressions, getDebug, getEdgeModificationCount, getMark, getNewNodes, getNode, getNodeCount, getNodes, getNodes, getNodesDeletedSinceLastCompression, getOptions, getTotalNodesDeleted, hasNode, isFrozen, isNew, isNodeModificationCountsEnabled, maybeCompress, minimizeSize, nodeIdCount, resetDebug, setTrackNodeSourcePosition, temporaryFreeze, trackNodeEvents, trackNodeSourcePosition, trackNodeSourcePositionDefault, unfreeze, unique, verify, verifySourcePositions, withNodeSourcePosition, withNodeSourcePosition, withoutNodeSourcePositionpublic static final long INVALID_GRAPH_ID
public static final boolean USE_PROFILING_INFO
public static final boolean NO_PROFILING_INFO
public void setLastSchedule(StructuredGraph.ScheduleResult result)
public StructuredGraph.ScheduleResult getLastSchedule()
public void clearLastSchedule()
public void getDebugProperties(Map<Object,Object> properties)
GraphgetDebugProperties in class Graphpublic void beforeNodeDuplication(Graph sourceGraph)
GraphsourceGraph by
NodeClass.addGraphDuplicate(org.graalvm.compiler.graph.Graph, org.graalvm.compiler.graph.Graph, int, java.lang.Iterable<? extends org.graalvm.compiler.graph.Node>, org.graalvm.compiler.graph.Graph.DuplicationReplacement) to allow the transfer of any other state which should
also be transferred.beforeNodeDuplication in class GraphsourceGraph - the source of the nodes that were duplicatedprotected Object beforeNodeIdChange(Node node)
beforeNodeIdChange in class Graphprotected void afterNodeIdChange(Node node, Object value)
afterNodeIdChange in class Graphpublic Stamp getReturnStamp()
public StartNode start()
public ResolvedJavaMethod method()
public int getEntryBCI()
public Cancellable getCancellable()
public void checkCancellation()
public boolean isOSR()
public long graphId()
public CompilationIdentifier compilationId()
CompilationIdentifierpublic void setStart(StartNode start)
public InliningLog getInliningLog()
null iff
GraalOptions.TraceInlining is false in Graph.getOptions().public void notifyInliningDecision(Invokable invoke, boolean positive, String phase, org.graalvm.collections.EconomicMap<Node,Node> replacements, InliningLog calleeLog, String reason, Object... args)
invoke.
An inlining decision can be either positive or negative. A positive inlining decision must be
logged after replacing an Invoke with a graph. In this case, the node replacement map
and the InliningLog of the inlined graph must be provided.invoke - the invocation to which the inlining decision pertainspositive - true if the invocation was inlined, false otherwisephase - name of the phase doing the inliningreplacements - the node replacement map used by inlining. Must be non-null if
positive == true, ignored if positive == false.calleeLog - the inlining log of the inlined graph. Must be non-null if
positive == true, ignored if positive == false.reason - format string that along with args provides the reason for decisionpublic void logInliningTree()
protected Graph copy(String newName, Consumer<org.graalvm.collections.UnmodifiableEconomicMap<Node,Node>> duplicationMapCallback, DebugContext debugForCopy)
copy in class GraphnewName - the name of the copy, used for debugging purposes (can be null)duplicationMapCallback - consumer of the duplication map created during the copyingdebugForCopy - the debug context for the graph copy. This must not be the debug for this
graph if this graph can be accessed from multiple threads (e.g., it's in a cache
accessed by multiple threads).public StructuredGraph copy(String newName, Consumer<org.graalvm.collections.UnmodifiableEconomicMap<Node,Node>> duplicationMapCallback, DebugContext debugForCopy, OptionValues options)
newName - the name of the copy, used for debugging purposes (can be null)duplicationMapCallback - consumer of the duplication map created during the copyingdebugForCopy - the debug context for the graph copy. This must not be the debug for this
graph if this graph can be accessed from multiple threads (e.g., it's in a cache
accessed by multiple threads).options - the option values for the graph copypublic StructuredGraph copyWithIdentifier(CompilationIdentifier newCompilationId, DebugContext debugForCopy)
debugForCopy - the debug context for the graph copy. This must not be the debug for this
graph if this graph can be accessed from multiple threads (e.g., it's in a cache
accessed by multiple threads).public StructuredGraph copy(ResolvedJavaMethod rootMethodForCopy, OptionValues optionsForCopy, DebugContext debugForCopy, boolean trackNodeSourcePositionForCopy)
public ParameterNode getParameter(int index)
public boolean hasLoops()
public void removeFixed(FixedWithNextNode node)
node - the node to be unlinked and removedpublic void replaceFixed(FixedWithNextNode node, Node replacement)
public void replaceFixedWithFixed(FixedWithNextNode node, FixedWithNextNode replacement)
public void replaceFixedWithFloating(FixedWithNextNode node, ValueNode replacement)
public void removeSplit(ControlSplitNode node, AbstractBeginNode survivingSuccessor)
public void removeSplitPropagate(ControlSplitNode node, AbstractBeginNode survivingSuccessor)
public void replaceSplit(ControlSplitNode node, Node replacement, AbstractBeginNode survivingSuccessor)
public void replaceSplitWithFixed(ControlSplitNode node, FixedWithNextNode replacement, AbstractBeginNode survivingSuccessor)
public void replaceSplitWithFloating(ControlSplitNode node, FloatingNode replacement, AbstractBeginNode survivingSuccessor)
public void replaceWithExceptionSplit(WithExceptionNode node, WithExceptionNode replacement)
public void addAfterFixed(FixedWithNextNode node, FixedNode newNode)
public void addBeforeFixed(FixedNode node, FixedWithNextNode newNode)
public void reduceDegenerateLoopBegin(LoopBeginNode begin)
public void reduceTrivialMerge(AbstractMergeNode merge)
public StructuredGraph.GuardsStage getGuardsStage()
public void setGuardsStage(StructuredGraph.GuardsStage guardsStage)
public boolean isBeforeStage(StructuredGraph.StageFlag stage)
public boolean isDuringStage(StructuredGraph.StageFlag stage)
StructuredGraph.isAfterStage(StageFlag) may become true for a stage even if
StructuredGraph.isDuringStage(StageFlag) was never set for that stage.public boolean isAfterStage(StructuredGraph.StageFlag stage)
public void setDuringStage(StructuredGraph.StageFlag stage)
public void setAfterStage(StructuredGraph.StageFlag stage)
public EnumSet<StructuredGraph.StageFlag> getStageFlags()
public ProfileProvider getProfileProvider()
ProfileProvider in use for the graph.public boolean isSubstitution()
Snippet. This is preferred over querying
annotations directly as querying annotations can cause class loading.public ProfilingInfo getProfilingInfo()
public ProfilingInfo getProfilingInfo(ResolvedJavaMethod m)
StructuredGraph.getProfileProvider().public Assumptions getAssumptions()
null if assumptions cannot be made for this graphpublic StructuredGraph.AllowAssumptions allowAssumptions()
AllowAssumptions.YES if this graph allows recording assumptions,
AllowAssumptions.NO otherwisepublic void recordAssumptions(StructuredGraph inlineGraph)
public List<ResolvedJavaMethod> getMethods()
public void recordMethod(ResolvedJavaMethod method)
method was used to build this graph.public void updateMethods(StructuredGraph other)
public int getBytecodeSize()
public JavaMethod asJavaMethod()
asJavaMethod in interface JavaMethodContextpublic boolean hasUnsafeAccess()
public void markUnsafeAccess()
public void disableUnsafeAccessTracking()
public boolean isUnsafeAccessTrackingEnabled()
public SpeculationLog getSpeculationLog()
public StructuredGraph.FrameStateVerification getFrameStateVerification()
public boolean isStateAfterClearedForTesting()
public void weakenFrameStateVerification(StructuredGraph.FrameStateVerification newFrameStateVerification)
public void disableFrameStateVerification()
public void clearAllStateAfterForTestingOnly()
public boolean hasVirtualizableAllocation()
protected void afterRegister(Node node)
afterRegister in class Graphpublic NodeSourcePosition getCallerContext()