changeset 15994:1b07ca2f6c39

[inliner] break method up, to enable delaying specializeGraphToArguments()
author Miguel Garcia <miguel.m.garcia@oracle.com>
date Mon, 02 Jun 2014 16:53:23 +0200
parents c13b6c4e2786
children 66fe80527060
files graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/info/elem/InlineableGraph.java
diffstat 1 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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 <code>newGraph</code> 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<Node> 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);
         }