public class InlineableGraph extends Object implements Inlineable
Represents a feasible concrete target for inlining, whose graph has been copied already and thus can be modified without affecting the original (usually cached) version.
Instances of this class don't make sense in isolation but as part of an
InlineInfo
.
Modifier and Type | Field and Description |
---|---|
private StructuredGraph |
graph |
private FixedNodeProbabilityCache |
probabilites |
Constructor and Description |
---|
InlineableGraph(ResolvedJavaMethod method,
Invoke invoke,
HighTierContext context,
CanonicalizerPhase canonicalizer) |
Modifier and Type | Method and Description |
---|---|
private static boolean |
canStampBeImproved(ValueNode arg,
ParameterNode param) |
StructuredGraph |
getGraph() |
Iterable<Invoke> |
getInvokes() |
int |
getNodeCount() |
private static StructuredGraph |
getOriginalGraph(ResolvedJavaMethod method,
HighTierContext context,
CanonicalizerPhase canonicalizer,
StructuredGraph caller,
int callerBci)
This method looks up in a cache the graph for the argument, if not found bytecode is parsed.
|
double |
getProbability(Invoke invoke) |
private static Stamp |
improvedStamp(ValueNode arg,
ParameterNode param) |
private static boolean |
isArgMoreInformativeThanParam(ValueNode arg,
ParameterNode param) |
private static StructuredGraph |
parseBytecodes(ResolvedJavaMethod method,
HighTierContext context,
CanonicalizerPhase canonicalizer,
StructuredGraph caller)
This method builds the IR nodes for the given
method and canonicalizes them. |
private ArrayList<Node> |
replaceParamsWithMoreInformativeArguments(Invoke invoke,
HighTierContext context)
This method detects:
constants among the arguments to the
invoke
arguments with more precise type than that declared by the corresponding parameter
|
private boolean |
specializeGraphToArguments(Invoke invoke,
HighTierContext context,
CanonicalizerPhase canonicalizer) |
private static ArrayList<Node> |
trackParameterUsages(ParameterNode param,
ArrayList<Node> parameterUsages) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getInlineableElement
private final StructuredGraph graph
private FixedNodeProbabilityCache probabilites
public InlineableGraph(ResolvedJavaMethod method, Invoke invoke, HighTierContext context, CanonicalizerPhase canonicalizer)
private static StructuredGraph getOriginalGraph(ResolvedJavaMethod method, HighTierContext context, CanonicalizerPhase canonicalizer, StructuredGraph caller, int callerBci)
private boolean specializeGraphToArguments(Invoke invoke, HighTierContext context, CanonicalizerPhase canonicalizer)
newGraph
were specialized to account for
a constant argument, or an argument with a more specific stamp.private static boolean isArgMoreInformativeThanParam(ValueNode arg, ParameterNode param)
private static boolean canStampBeImproved(ValueNode arg, ParameterNode param)
private static Stamp improvedStamp(ValueNode arg, ParameterNode param)
private ArrayList<Node> replaceParamsWithMoreInformativeArguments(Invoke invoke, HighTierContext context)
invoke
The corresponding parameters are updated to reflect the above information. Before doing so,
their usages are added to parameterUsages
for later incremental
canonicalization.
private static ArrayList<Node> trackParameterUsages(ParameterNode param, ArrayList<Node> parameterUsages)
private static StructuredGraph parseBytecodes(ResolvedJavaMethod method, HighTierContext context, CanonicalizerPhase canonicalizer, StructuredGraph caller)
method
and canonicalizes them.
Provided profiling info is mature, the resulting graph is cached. The caller is responsible
for cloning before modification. public int getNodeCount()
getNodeCount
in interface Inlineable
public Iterable<Invoke> getInvokes()
getInvokes
in interface Inlineable
public double getProbability(Invoke invoke)
getProbability
in interface Inlineable
public StructuredGraph getGraph()