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
Assumption s can be made while processing a graph. |
static class |
StructuredGraph.Builder
Object used to create a
StructuredGraph . |
static class |
StructuredGraph.ScheduleResult |
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 |
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() |
GraphState |
getGraphState() |
GraphState.GuardsStage |
getGuardsStage()
Returns the guards stage of this graph.
|
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()
Returns the
SpeculationLog for this graph. |
long |
graphId() |
boolean |
hasLoops() |
boolean |
hasUnsafeAccess() |
boolean |
hasVirtualizableAllocation() |
boolean |
isAfterStage(GraphState.StageFlag stage)
|
boolean |
isBeforeStage(GraphState.StageFlag stage)
|
boolean |
isOSR() |
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 |
reduceDegenerateLoopBegin(LoopBeginNode begin,
boolean forKillCFG) |
void |
reduceTrivialMerge(AbstractMergeNode merge) |
void |
reduceTrivialMerge(AbstractMergeNode merge,
boolean forKillCFG) |
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 |
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.
|
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, withoutNodeSourcePosition
public 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)
Graph
getDebugProperties
in class Graph
public void beforeNodeDuplication(Graph sourceGraph)
Graph
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.beforeNodeDuplication
in class Graph
sourceGraph
- the source of the nodes that were duplicatedprotected Object beforeNodeIdChange(Node node)
beforeNodeIdChange
in class Graph
protected void afterNodeIdChange(Node node, Object value)
afterNodeIdChange
in class Graph
public Stamp getReturnStamp()
public StartNode start()
public ResolvedJavaMethod method()
public int getEntryBCI()
public GraphState getGraphState()
public GraphState.GuardsStage getGuardsStage()
GraphState.getGuardsStage()
.public SpeculationLog getSpeculationLog()
SpeculationLog
for this graph. See
GraphState.getSpeculationLog()
.public boolean isBeforeStage(GraphState.StageFlag stage)
public boolean isAfterStage(GraphState.StageFlag stage)
public Cancellable getCancellable()
public void checkCancellation()
public boolean isOSR()
public long graphId()
public CompilationIdentifier compilationId()
CompilationIdentifier
public 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 Graph
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).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 reduceDegenerateLoopBegin(LoopBeginNode begin, boolean forKillCFG)
public void reduceTrivialMerge(AbstractMergeNode merge)
public void reduceTrivialMerge(AbstractMergeNode merge, boolean forKillCFG)
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 JavaMethodContext
public boolean hasUnsafeAccess()
public void markUnsafeAccess()
public void disableUnsafeAccessTracking()
public boolean isUnsafeAccessTrackingEnabled()
public void clearAllStateAfterForTestingOnly()
public boolean hasVirtualizableAllocation()
protected void afterRegister(Node node)
afterRegister
in class Graph
public NodeSourcePosition getCallerContext()