use of org.graalvm.compiler.phases.common.inlining.info.elem.InlineableGraph in project graal by oracle.
the class InliningData method topGraphsForTopInvocation.
/**
* Checks an invariant that {@link #moveForward()} must maintain: "the top invocation records
* how many concrete target methods (for it) remain on the {@link #graphQueue}; those targets
* 'belong' to the current invocation in question.
*/
private boolean topGraphsForTopInvocation() {
if (invocationQueue.isEmpty()) {
assert graphQueue.isEmpty();
return true;
}
if (currentInvocation().isRoot()) {
if (!graphQueue.isEmpty()) {
assert graphQueue.size() == 1;
}
return true;
}
final int remainingGraphs = currentInvocation().totalGraphs() - currentInvocation().processedGraphs();
final Iterator<CallsiteHolder> iter = graphQueue.iterator();
for (int i = (remainingGraphs - 1); i >= 0; i--) {
if (!iter.hasNext()) {
assert false;
return false;
}
CallsiteHolder queuedTargetCH = iter.next();
Inlineable targetIE = currentInvocation().callee().inlineableElementAt(i);
InlineableGraph targetIG = (InlineableGraph) targetIE;
assert queuedTargetCH.method().equals(targetIG.getGraph().method());
}
return true;
}
use of org.graalvm.compiler.phases.common.inlining.info.elem.InlineableGraph in project graal by oracle.
the class MethodInvocation method buildCallsiteHolderForElement.
public CallsiteHolder buildCallsiteHolderForElement(int index) {
Inlineable elem = callee.inlineableElementAt(index);
assert elem instanceof InlineableGraph;
InlineableGraph ig = (InlineableGraph) elem;
final double invokeProbability = probability * callee.probabilityAt(index);
final double invokeRelevance = relevance * callee.relevanceAt(index);
return new CallsiteHolderExplorable(ig.getGraph(), invokeProbability, invokeRelevance, freshlyInstantiatedArguments, null);
}
Aggregations