Search in sources :

Example 1 with InlineableGraph

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;
}
Also used : InlineableGraph(org.graalvm.compiler.phases.common.inlining.info.elem.InlineableGraph) Inlineable(org.graalvm.compiler.phases.common.inlining.info.elem.Inlineable)

Example 2 with InlineableGraph

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);
}
Also used : InlineableGraph(org.graalvm.compiler.phases.common.inlining.info.elem.InlineableGraph) Inlineable(org.graalvm.compiler.phases.common.inlining.info.elem.Inlineable)

Aggregations

Inlineable (org.graalvm.compiler.phases.common.inlining.info.elem.Inlineable)2 InlineableGraph (org.graalvm.compiler.phases.common.inlining.info.elem.InlineableGraph)2