# HG changeset patch # User Miguel Garcia # Date 1401374101 -7200 # Node ID 1fbefda059a6711b21b9a6a8d5f862b9605ebed0 # Parent aa28d876651a0c99f24b5f416aba1f194b26550a [inlining] documentation and assertions diff -r aa28d876651a -r 1fbefda059a6 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/walker/InliningData.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/walker/InliningData.java Wed May 28 17:24:38 2014 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/walker/InliningData.java Thu May 29 16:35:01 2014 +0200 @@ -380,6 +380,7 @@ */ private boolean tryToInline(CallsiteHolder callerCallsiteHolder, MethodInvocation calleeInvocation, MethodInvocation parentInvocation, int inliningDepth) { InlineInfo calleeInfo = calleeInvocation.callee(); + assert iterContains(callerCallsiteHolder.graph().getInvokes(), calleeInfo.invoke()); Assumptions callerAssumptions = parentInvocation.assumptions(); metricInliningConsidered.increment(); @@ -395,6 +396,15 @@ return false; } + private static boolean iterContains(Iterable in, T elem) { + for (T i : in) { + if (i == elem) { + return true; + } + } + return false; + } + /** * Process the next invoke and enqueue all its graphs for processing. */ @@ -585,6 +595,10 @@ assert currentInvocation.callee().invoke().asNode().isAlive(); currentInvocation.incrementProcessedGraphs(); if (currentInvocation.processedGraphs() == currentInvocation.totalGraphs()) { + /* + * "all of currentInvocation's graphs processed" amounts to + * "all concrete methods that come into question already had the callees they contain analyzed for inlining" + */ popInvocation(); final MethodInvocation parentInvoke = currentInvocation(); try (Debug.Scope s = Debug.scope("Inlining", inliningContext())) {