public class InliningUtil extends ValueMergeUtil
| Modifier and Type | Class and Description |
|---|---|
static class |
InliningUtil.InlineeReturnAction
Pre-processing hook for special handling of inlinee return nodes during inlining.
|
| Modifier and Type | Field and Description |
|---|---|
static InliningUtil.InlineeReturnAction |
NoReturnAction |
| Constructor and Description |
|---|
InliningUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String |
checkInvokeConditions(Invoke invoke) |
static PiNode |
createAnchoredReceiver(StructuredGraph graph,
GuardingNode anchor,
ResolvedJavaType commonType,
ValueNode receiver,
boolean exact) |
static SpeculationLog.SpeculationReason |
createSpeculation(Invoke invoke,
JavaTypeProfile typeProfile) |
static int |
getNodeCount(StructuredGraph graph)
This method exclude InstrumentationNode from inlining heuristics.
|
static FrameState |
handleMissingAfterExceptionFrameState(FrameState nonReplaceableFrameState,
Invoke invoke,
org.graalvm.collections.EconomicMap<Node,Node> replacements,
boolean alwaysDuplicateStateAfter) |
static org.graalvm.collections.UnmodifiableEconomicMap<Node,Node> |
inline(Invoke invoke,
StructuredGraph inlineGraph,
boolean receiverNullCheck,
ResolvedJavaMethod inlineeMethod)
Performs an actual inlining, thereby replacing the given invoke with the given
inlineGraph. |
static org.graalvm.collections.UnmodifiableEconomicMap<Node,Node> |
inline(Invoke invoke,
StructuredGraph inlineGraph,
boolean receiverNullCheck,
ResolvedJavaMethod inlineeMethod,
String reason,
String phase) |
static org.graalvm.collections.UnmodifiableEconomicMap<Node,Node> |
inline(Invoke invoke,
StructuredGraph inlineGraph,
boolean receiverNullCheck,
ResolvedJavaMethod inlineeMethod,
String reason,
String phase,
InliningUtil.InlineeReturnAction returnAction)
Performs an actual inlining, thereby replacing the given invoke with the given
inlineGraph. |
static org.graalvm.collections.EconomicSet<Node> |
inlineForCanonicalization(Invoke invoke,
StructuredGraph inlineGraph,
boolean receiverNullCheck,
ResolvedJavaMethod inlineeMethod,
Consumer<org.graalvm.collections.UnmodifiableEconomicMap<Node,Node>> duplicatesConsumer,
String reason,
String phase) |
static org.graalvm.collections.EconomicSet<Node> |
inlineForCanonicalization(Invoke invoke,
StructuredGraph inlineGraph,
boolean receiverNullCheck,
ResolvedJavaMethod inlineeMethod,
Consumer<org.graalvm.collections.UnmodifiableEconomicMap<Node,Node>> duplicatesConsumer,
String reason,
String phase,
InliningUtil.InlineeReturnAction action) |
static org.graalvm.collections.EconomicSet<Node> |
inlineForCanonicalization(Invoke invoke,
StructuredGraph inlineGraph,
boolean receiverNullCheck,
ResolvedJavaMethod inlineeMethod,
String reason,
String phase)
Inline
inlineGraph into the current replacing the node Invoke and return the
set of nodes which should be canonicalized. |
static void |
insertTypeGuard(CoreProviders providers,
Invoke invoke,
ResolvedJavaType type,
Speculation speculation) |
static void |
logInliningDecision(DebugContext debug,
String msg,
Object... args)
Output a generic inlining decision to the logging stream (e.g.
|
static void |
logNotInlinedMethod(Invoke invoke,
String msg)
Output a decision about not inlining a method to the logging stream, for debugging purposes.
|
static ValueNode |
nonNullReceiver(Invoke invoke)
Gets the receiver for an invoke, adding a guard if necessary to ensure it is non-null, and
ensuring that the resulting type is compatible with the method being invoked.
|
static FrameState |
processFrameState(FrameState frameState,
Invoke invoke,
org.graalvm.collections.EconomicMap<Node,Node> replacements,
ResolvedJavaMethod inlinedMethod,
FrameState stateAtExceptionEdge,
FrameState outerFrameState,
boolean alwaysDuplicateStateAfter,
ResolvedJavaMethod invokeTargetMethod,
List<ValueNode> invokeArgsList) |
protected static void |
processFrameStates(Invoke invoke,
StructuredGraph inlineGraph,
org.graalvm.collections.EconomicMap<Node,Node> duplicates,
FrameState stateAtExceptionEdge,
boolean alwaysDuplicateStateAfter) |
static void |
processMonitorId(FrameState stateAfter,
MonitorIdNode monitorIdNode) |
static org.graalvm.collections.Pair<ValueNode,FixedNode> |
replaceInvokeAtUsages(ValueNode invokeNode,
ValueNode origReturn,
FixedNode anchorCandidate)
Replaces invoke's usages with the provided return value while also insuring the new value's
stamp is not weaker than the original invoke's stamp.
|
static void |
replaceInvokeCallTarget(Invoke invoke,
StructuredGraph graph,
CallTargetNode.InvokeKind invokeKind,
ResolvedJavaMethod targetMethod) |
static void |
traceInlinedMethod(InlineInfo info,
int inliningDepth,
boolean allowLogging,
String msg,
Object... args)
Trace a decision to inline a method.
|
static void |
traceInlinedMethod(Invoke invoke,
int inliningDepth,
boolean allowLogging,
ResolvedJavaMethod method,
String msg,
Object... args)
Trace a decision to inline a method.
|
static void |
traceNotInlinedMethod(InlineInfo info,
int inliningDepth,
String msg,
Object... args)
Trace a decision to not inline a method.
|
static void |
traceNotInlinedMethod(Invoke invoke,
int inliningDepth,
ResolvedJavaMethod method,
String msg,
Object... args)
Trace a decision about not inlining a method.
|
static void |
updateSourcePosition(StructuredGraph invokeGraph,
org.graalvm.collections.UnmodifiableEconomicMap<Node,Node> duplicates,
Graph.Mark mark,
NodeSourcePosition invokePos,
boolean isSubstitution) |
mergeReturns, mergeUnwindExceptions, mergeValueProducerspublic static InliningUtil.InlineeReturnAction NoReturnAction
public static void traceInlinedMethod(InlineInfo info, int inliningDepth, boolean allowLogging, String msg, Object... args)
InliningUtil.traceNotInlinedMethod(org.graalvm.compiler.phases.common.inlining.info.InlineInfo, int, java.lang.String, java.lang.Object...) methods only for debugging purposes.public static void traceInlinedMethod(Invoke invoke, int inliningDepth, boolean allowLogging, ResolvedJavaMethod method, String msg, Object... args)
InliningUtil.traceNotInlinedMethod(org.graalvm.compiler.phases.common.inlining.info.InlineInfo, int, java.lang.String, java.lang.Object...) methods only for debugging purposes.public static void traceNotInlinedMethod(InlineInfo info, int inliningDepth, String msg, Object... args)
InliningUtil.traceNotInlinedMethod(org.graalvm.compiler.phases.common.inlining.info.InlineInfo, int, java.lang.String, java.lang.Object...) methods only for debugging purposes.public static void traceNotInlinedMethod(Invoke invoke, int inliningDepth, ResolvedJavaMethod method, String msg, Object... args)
InliningUtil.traceNotInlinedMethod(org.graalvm.compiler.phases.common.inlining.info.InlineInfo, int, java.lang.String, java.lang.Object...) methods only for debugging purposes.public static void logInliningDecision(DebugContext debug, String msg, Object... args)
public static void logNotInlinedMethod(Invoke invoke, String msg)
public static void replaceInvokeCallTarget(Invoke invoke, StructuredGraph graph, CallTargetNode.InvokeKind invokeKind, ResolvedJavaMethod targetMethod)
public static PiNode createAnchoredReceiver(StructuredGraph graph, GuardingNode anchor, ResolvedJavaType commonType, ValueNode receiver, boolean exact)
public static String checkInvokeConditions(Invoke invoke)
public static org.graalvm.collections.UnmodifiableEconomicMap<Node,Node> inline(Invoke invoke, StructuredGraph inlineGraph, boolean receiverNullCheck, ResolvedJavaMethod inlineeMethod)
inlineGraph.invoke - the invoke that will be replacedinlineGraph - the graph that the invoke will be replaced withreceiverNullCheck - true if a null check needs to be generated for non-static inlinings,
false if no such check is requiredinlineeMethod - the actual method being inlined. Maybe be null for snippets.public static org.graalvm.collections.UnmodifiableEconomicMap<Node,Node> inline(Invoke invoke, StructuredGraph inlineGraph, boolean receiverNullCheck, ResolvedJavaMethod inlineeMethod, String reason, String phase)
public static org.graalvm.collections.UnmodifiableEconomicMap<Node,Node> inline(Invoke invoke, StructuredGraph inlineGraph, boolean receiverNullCheck, ResolvedJavaMethod inlineeMethod, String reason, String phase, InliningUtil.InlineeReturnAction returnAction)
inlineGraph.invoke - the invoke that will be replacedinlineGraph - the graph that the invoke will be replaced withreceiverNullCheck - true if a null check needs to be generated for non-static inlinings,
false if no such check is requiredinlineeMethod - the actual method being inlined. Maybe be null for snippets.reason - the reason for inlining, used in tracingphase - the phase that invoked inliningpublic static org.graalvm.collections.EconomicSet<Node> inlineForCanonicalization(Invoke invoke, StructuredGraph inlineGraph, boolean receiverNullCheck, ResolvedJavaMethod inlineeMethod, String reason, String phase)
inlineGraph into the current replacing the node Invoke and return the
set of nodes which should be canonicalized. The set should only contain nodes which modified
by the inlining since the current graph and inlineGraph are expected to already be
canonical.invoke - inlineGraph - receiverNullCheck - inlineeMethod - public static org.graalvm.collections.EconomicSet<Node> inlineForCanonicalization(Invoke invoke, StructuredGraph inlineGraph, boolean receiverNullCheck, ResolvedJavaMethod inlineeMethod, Consumer<org.graalvm.collections.UnmodifiableEconomicMap<Node,Node>> duplicatesConsumer, String reason, String phase)
public static org.graalvm.collections.EconomicSet<Node> inlineForCanonicalization(Invoke invoke, StructuredGraph inlineGraph, boolean receiverNullCheck, ResolvedJavaMethod inlineeMethod, Consumer<org.graalvm.collections.UnmodifiableEconomicMap<Node,Node>> duplicatesConsumer, String reason, String phase, InliningUtil.InlineeReturnAction action)
public static org.graalvm.collections.Pair<ValueNode,FixedNode> replaceInvokeAtUsages(ValueNode invokeNode, ValueNode origReturn, FixedNode anchorCandidate)
public static void updateSourcePosition(StructuredGraph invokeGraph, org.graalvm.collections.UnmodifiableEconomicMap<Node,Node> duplicates, Graph.Mark mark, NodeSourcePosition invokePos, boolean isSubstitution)
public static void processMonitorId(FrameState stateAfter, MonitorIdNode monitorIdNode)
protected static void processFrameStates(Invoke invoke, StructuredGraph inlineGraph, org.graalvm.collections.EconomicMap<Node,Node> duplicates, FrameState stateAtExceptionEdge, boolean alwaysDuplicateStateAfter)
public static FrameState processFrameState(FrameState frameState, Invoke invoke, org.graalvm.collections.EconomicMap<Node,Node> replacements, ResolvedJavaMethod inlinedMethod, FrameState stateAtExceptionEdge, FrameState outerFrameState, boolean alwaysDuplicateStateAfter, ResolvedJavaMethod invokeTargetMethod, List<ValueNode> invokeArgsList)
public static FrameState handleMissingAfterExceptionFrameState(FrameState nonReplaceableFrameState, Invoke invoke, org.graalvm.collections.EconomicMap<Node,Node> replacements, boolean alwaysDuplicateStateAfter)
public static ValueNode nonNullReceiver(Invoke invoke)
public static void insertTypeGuard(CoreProviders providers, Invoke invoke, ResolvedJavaType type, Speculation speculation)
public static SpeculationLog.SpeculationReason createSpeculation(Invoke invoke, JavaTypeProfile typeProfile)
public static int getNodeCount(StructuredGraph graph)