public class InliningLog extends Object
null if the decision was negativeStructuredGraph by calling InliningLog.addDecision(org.graalvm.compiler.nodes.Invokable, boolean, java.lang.String, org.graalvm.collections.EconomicMap<org.graalvm.compiler.graph.Node, org.graalvm.compiler.graph.Node>, org.graalvm.compiler.nodes.InliningLog, java.lang.String, java.lang.Object...) whenever it decides to inline a method.
If there are invokes in the graph at the end of the respective phase, then that phase must call
InliningLog.addDecision(org.graalvm.compiler.nodes.Invokable, boolean, java.lang.String, org.graalvm.collections.EconomicMap<org.graalvm.compiler.graph.Node, org.graalvm.compiler.graph.Node>, org.graalvm.compiler.nodes.InliningLog, java.lang.String, java.lang.Object...) to log negative decisions.| Modifier and Type | Class and Description |
|---|---|
static class |
InliningLog.Decision |
static class |
InliningLog.PlaceholderInvokable |
class |
InliningLog.RootScope
Used to change the current effective root of the method being compiled.
|
class |
InliningLog.UpdateScope
Used to designate scopes in which
Invokable registration or cloning should be handled
differently. |
| Constructor and Description |
|---|
InliningLog(ResolvedJavaMethod rootMethod) |
| Modifier and Type | Method and Description |
|---|---|
void |
addLeafCallsite(Invokable invokable,
org.graalvm.compiler.nodes.InliningLog.Callsite callsite)
This method must be called during graph compression, or other node-id changes.
|
void |
addLog(org.graalvm.collections.UnmodifiableEconomicMap<Node,Node> replacements,
InliningLog replacementLog)
Appends the inlining decision tree from
replacementLog to this log. |
void |
checkInvariants(StructuredGraph graph) |
boolean |
containsLeafCallsite(Invokable invokable) |
String |
formatAsTree(boolean nullIfEmpty)
Formats the inlining log as a hierarchical tree.
|
BiConsumer<Invokable,Invokable> |
getUpdateScope() |
static InliningLog.UpdateScope |
openDefaultUpdateScope(InliningLog log)
Creates a new update scope that does not update
log. |
InliningLog.RootScope |
openRootScope(Invokable invoke) |
InliningLog.RootScope |
openRootScope(ResolvedJavaMethod callerMethod,
ResolvedJavaMethod target,
int bci) |
InliningLog.UpdateScope |
openUpdateScope(BiConsumer<Invokable,Invokable> updater)
Creates and sets a new update scope for the log.
|
org.graalvm.compiler.nodes.InliningLog.Callsite |
removeLeafCallsite(Invokable invokable) |
void |
replaceLog(org.graalvm.collections.UnmodifiableEconomicMap<Node,Node> replacements,
InliningLog replacementLog)
Completely replace this log's contents with a copy of
replacementLog's contents. |
void |
trackDuplicatedCallsite(Invokable sibling,
Invokable newInvoke) |
void |
trackNewCallsite(Invokable invoke) |
void |
updateExistingCallsite(Invokable previousInvoke,
Invokable newInvoke) |
public void addLog(org.graalvm.collections.UnmodifiableEconomicMap<Node,Node> replacements, InliningLog replacementLog)
replacementLog to this log.
This is called for example when a node in a graph is replaced with a snippet.replacementLog - if non-null, its subtrees are appended below the root of this log.InliningLog.addDecision(org.graalvm.compiler.nodes.Invokable, boolean, java.lang.String, org.graalvm.collections.EconomicMap<org.graalvm.compiler.graph.Node, org.graalvm.compiler.graph.Node>, org.graalvm.compiler.nodes.InliningLog, java.lang.String, java.lang.Object...)public void replaceLog(org.graalvm.collections.UnmodifiableEconomicMap<Node,Node> replacements, InliningLog replacementLog)
replacementLog's contents.
The precondition is that this inlining log is completely empty. This is usually called as
part of graph copying.public void checkInvariants(StructuredGraph graph)
public BiConsumer<Invokable,Invokable> getUpdateScope()
public InliningLog.UpdateScope openUpdateScope(BiConsumer<Invokable,Invokable> updater)
updater is invoked when an Invokable node is registered or
cloned. If the node is newly registered, then the first argument to the updater is
null. If the node is cloned, then the first argument is the node it was cloned from.updater - an operation taking a null (or the original node), and the registered (or
cloned) InvokableInliningLog.UpdateScope object, or a null if tracing is disabledpublic static InliningLog.UpdateScope openDefaultUpdateScope(InliningLog log)
log.
This update scope will not add a newly created Invokable to the log, nor will it
amend its position if it was cloned. Instead, users need to update the inlining log with the
new Invokable on their own.public InliningLog.RootScope openRootScope(ResolvedJavaMethod callerMethod, ResolvedJavaMethod target, int bci)
public InliningLog.RootScope openRootScope(Invokable invoke)
public boolean containsLeafCallsite(Invokable invokable)
public org.graalvm.compiler.nodes.InliningLog.Callsite removeLeafCallsite(Invokable invokable)
public void addLeafCallsite(Invokable invokable, org.graalvm.compiler.nodes.InliningLog.Callsite callsite)
public void trackNewCallsite(Invokable invoke)
public void updateExistingCallsite(Invokable previousInvoke, Invokable newInvoke)
public String formatAsTree(boolean nullIfEmpty)
nullIfEmpty - specifies whether null should be returned if there are no inlining
decisions