# HG changeset patch # User Miguel Garcia # Date 1401720803 -7200 # Node ID 1b07ca2f6c39d02204caa2059282be13e9b83285 # Parent c13b6c4e27864c8fa624952eecde6277310342f7 [inliner] break method up, to enable delaying specializeGraphToArguments() diff -r c13b6c4e2786 -r 1b07ca2f6c39 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/info/elem/InlineableGraph.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/info/elem/InlineableGraph.java Mon Jun 02 16:39:19 2014 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/info/elem/InlineableGraph.java Mon Jun 02 16:53:23 2014 +0200 @@ -70,19 +70,30 @@ // TODO (chaeubl): copying the graph is only necessary if it is modified or if it contains // any invokes + specializeGraphToArguments(newGraph, invoke, context, canonicalizer); + + return newGraph; + } + + /** + * @return true iff one or more parameters newGraph were specialized to account for + * a constant argument, or an argument with a more specific stamp. + */ + private static boolean specializeGraphToArguments(final StructuredGraph newGraph, final Invoke invoke, final HighTierContext context, CanonicalizerPhase canonicalizer) { try (Debug.Scope s = Debug.scope("InlineGraph", newGraph)) { ArrayList parameterUsages = replaceParamsWithMoreInformativeArguments(invoke, newGraph, context); if (parameterUsages != null && OptCanonicalizer.getValue()) { assert !parameterUsages.isEmpty() : "The caller didn't have more information about arguments after all"; canonicalizer.applyIncremental(newGraph, context, parameterUsages); + return true; } else { // TODO (chaeubl): if args are not more concrete, inlining should be avoided // in most cases or we could at least use the previous graph size + invoke // probability to check the inlining + return false; } - return newGraph; } catch (Throwable e) { throw Debug.handle(e); }