public class MultiTypeGuardInlineInfo extends AbstractInlineInfo
Modifier and Type | Field and Description |
---|---|
private List<ResolvedJavaMethod> |
concretes |
private Inlineable[] |
inlineableElements |
private double |
maximumMethodProbability |
private double[] |
methodProbabilities |
private double |
notRecordedTypeProbability |
private ArrayList<JavaTypeProfile.ProfiledType> |
ptypes |
private ArrayList<Integer> |
typesToConcretes |
invoke
Constructor and Description |
---|
MultiTypeGuardInlineInfo(Invoke invoke,
ArrayList<ResolvedJavaMethod> concretes,
ArrayList<JavaTypeProfile.ProfiledType> ptypes,
ArrayList<Integer> typesToConcretes,
double notRecordedTypeProbability) |
Modifier and Type | Method and Description |
---|---|
private static boolean |
assertUniqueTypes(ArrayList<JavaTypeProfile.ProfiledType> ptypes) |
private double[] |
computeMethodProbabilities() |
private boolean |
createDispatchOnTypeBeforeInvoke(StructuredGraph graph,
AbstractBeginNode[] successors,
boolean invokeIsOnlySuccessor,
StampProvider stampProvider) |
private static AbstractBeginNode |
createInvocationBlock(StructuredGraph graph,
Invoke invoke,
AbstractMergeNode returnMerge,
PhiNode returnValuePhi,
AbstractMergeNode exceptionMerge,
PhiNode exceptionObjectPhi,
boolean useForInlining) |
private static AbstractBeginNode |
createUnknownTypeSuccessor(StructuredGraph graph) |
private void |
devirtualizeWithTypeSwitch(StructuredGraph graph,
CallTargetNode.InvokeKind kind,
ResolvedJavaMethod target,
StampProvider stampProvider) |
private static Invoke |
duplicateInvokeForInlining(StructuredGraph graph,
Invoke invoke,
AbstractMergeNode exceptionMerge,
PhiNode exceptionObjectPhi,
boolean useForInlining) |
private ResolvedJavaType |
getLeastCommonType() |
private ResolvedJavaType |
getLeastCommonType(int concreteMethodIndex) |
private int |
getTypeCount(int concreteMethodIndex) |
private boolean |
hasSingleMethod() |
Collection<Node> |
inline(Providers providers)
Performs the inlining described by this object and returns the node that represents the
return value of the inlined method (or null for void methods and methods that have no
non-exceptional exit).
|
Inlineable |
inlineableElementAt(int index) |
private Collection<Node> |
inlineMultipleMethods(StructuredGraph graph,
Providers providers) |
private Collection<Node> |
inlineSingleMethod(StructuredGraph graph,
StampProvider stampProvider) |
private double |
maximumMethodProbability() |
ResolvedJavaMethod |
methodAt(int index) |
int |
numberOfMethods()
Returns the number of methods that may be inlined by the
invocation . |
double |
probabilityAt(int index) |
double |
relevanceAt(int index) |
void |
setInlinableElement(int index,
Inlineable inlineableElement) |
private boolean |
shouldFallbackToInvoke() |
boolean |
shouldInline() |
String |
toString() |
void |
tryToDevirtualizeInvoke(Providers providers)
Try to make the call static bindable to avoid interface and virtual method calls.
|
private void |
tryToDevirtualizeMultipleMethods(StructuredGraph graph,
StampProvider stampProvider) |
determineNodeCount, getInlinedParameterUsages, graph, inline, invoke, populateInlinableElements
private final List<ResolvedJavaMethod> concretes
private final double[] methodProbabilities
private final double maximumMethodProbability
private final ArrayList<Integer> typesToConcretes
private final ArrayList<JavaTypeProfile.ProfiledType> ptypes
private final double notRecordedTypeProbability
private final Inlineable[] inlineableElements
public MultiTypeGuardInlineInfo(Invoke invoke, ArrayList<ResolvedJavaMethod> concretes, ArrayList<JavaTypeProfile.ProfiledType> ptypes, ArrayList<Integer> typesToConcretes, double notRecordedTypeProbability)
private static boolean assertUniqueTypes(ArrayList<JavaTypeProfile.ProfiledType> ptypes)
private double[] computeMethodProbabilities()
private double maximumMethodProbability()
public int numberOfMethods()
InlineInfo
invocation
. This
may be more than one in the case of a invocation profile showing a number of "hot" concrete
methods dispatched to by the invocation.public ResolvedJavaMethod methodAt(int index)
public Inlineable inlineableElementAt(int index)
public double probabilityAt(int index)
public double relevanceAt(int index)
public void setInlinableElement(int index, Inlineable inlineableElement)
public Collection<Node> inline(Providers providers)
InlineInfo
public boolean shouldInline()
private boolean hasSingleMethod()
private boolean shouldFallbackToInvoke()
private Collection<Node> inlineMultipleMethods(StructuredGraph graph, Providers providers)
private int getTypeCount(int concreteMethodIndex)
private ResolvedJavaType getLeastCommonType(int concreteMethodIndex)
private ResolvedJavaType getLeastCommonType()
private Collection<Node> inlineSingleMethod(StructuredGraph graph, StampProvider stampProvider)
private boolean createDispatchOnTypeBeforeInvoke(StructuredGraph graph, AbstractBeginNode[] successors, boolean invokeIsOnlySuccessor, StampProvider stampProvider)
private static AbstractBeginNode createInvocationBlock(StructuredGraph graph, Invoke invoke, AbstractMergeNode returnMerge, PhiNode returnValuePhi, AbstractMergeNode exceptionMerge, PhiNode exceptionObjectPhi, boolean useForInlining)
private static Invoke duplicateInvokeForInlining(StructuredGraph graph, Invoke invoke, AbstractMergeNode exceptionMerge, PhiNode exceptionObjectPhi, boolean useForInlining)
public void tryToDevirtualizeInvoke(Providers providers)
InlineInfo
private void tryToDevirtualizeMultipleMethods(StructuredGraph graph, StampProvider stampProvider)
private void devirtualizeWithTypeSwitch(StructuredGraph graph, CallTargetNode.InvokeKind kind, ResolvedJavaMethod target, StampProvider stampProvider)
private static AbstractBeginNode createUnknownTypeSuccessor(StructuredGraph graph)