changeset 15998:9b9d0017168c

[inliner] removed a method, lost nothing (but code is more readable afterwards)
author Miguel Garcia <miguel.m.garcia@oracle.com>
date Mon, 02 Jun 2014 17:27:33 +0200
parents 2b79ddf41d2f
children 096848853662
files graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/info/elem/InlineableGraph.java
diffstat 1 files changed, 10 insertions(+), 21 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 17:20:11 2014 +0200
+++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/info/elem/InlineableGraph.java	Mon Jun 02 17:27:33 2014 +0200
@@ -42,38 +42,27 @@
     private final StructuredGraph graph;
 
     public InlineableGraph(final ResolvedJavaMethod method, final Invoke invoke, final HighTierContext context, CanonicalizerPhase canonicalizer) {
-        StructuredGraph original = buildGraph(method, context, canonicalizer);
+        StructuredGraph original = getOriginalGraph(method, context, canonicalizer);
         // TODO copying the graph is only necessary if it is modified or if it contains any invokes
         this.graph = original.copy();
         specializeGraphToArguments(invoke, context, canonicalizer);
     }
 
     /**
-     * @return a (possibly cached) graph. The caller is responsible for cloning before modification.
-     */
-    private static StructuredGraph getOriginalGraph(final ResolvedJavaMethod method, final HighTierContext context) {
-        StructuredGraph intrinsicGraph = InliningUtil.getIntrinsicGraph(context.getReplacements(), method);
-        if (intrinsicGraph != null) {
-            return intrinsicGraph;
-        }
-        StructuredGraph cachedGraph = getCachedGraph(method, context);
-        if (cachedGraph != null) {
-            return cachedGraph;
-        }
-        return null;
-    }
-
-    /**
      * This method looks up in a cache the graph for the argument, if not found bytecode is parsed.
      * The graph thus obtained is returned, ie the caller is responsible for cloning before
      * modification.
      */
-    private static StructuredGraph buildGraph(final ResolvedJavaMethod method, final HighTierContext context, CanonicalizerPhase canonicalizer) {
-        StructuredGraph result = getOriginalGraph(method, context);
-        if (result == null) {
-            result = parseBytecodes(method, context, canonicalizer);
+    private static StructuredGraph getOriginalGraph(final ResolvedJavaMethod method, final HighTierContext context, CanonicalizerPhase canonicalizer) {
+        StructuredGraph result = InliningUtil.getIntrinsicGraph(context.getReplacements(), method);
+        if (result != null) {
+            return result;
         }
-        return result;
+        result = getCachedGraph(method, context);
+        if (result != null) {
+            return result;
+        }
+        return parseBytecodes(method, context, canonicalizer);
     }
 
     /**