changeset 21400:33d3be2548d6

removed cache for intermediate graphs in ReplacementsImpl since graph building inlining is now used
author Doug Simon <doug.simon@oracle.com>
date Fri, 15 May 2015 13:45:06 +0200
parents 307a1ee8f714
children 7ea471ed17e4
files graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/ReplacementsImpl.java
diffstat 1 files changed, 2 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/ReplacementsImpl.java	Fri May 15 11:55:52 2015 +0200
+++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/ReplacementsImpl.java	Fri May 15 13:45:06 2015 +0200
@@ -462,11 +462,6 @@
     }
 
     /**
-     * Cache to speed up preprocessing of replacement graphs.
-     */
-    final ConcurrentMap<ResolvedJavaMethod, StructuredGraph> graphCache = new ConcurrentHashMap<>();
-
-    /**
      * Creates and preprocesses a graph for a replacement.
      */
     public static class GraphMaker {
@@ -493,12 +488,8 @@
 
         public StructuredGraph makeGraph(Object[] args) {
             try (Scope s = Debug.scope("BuildSnippetGraph", method)) {
-                StructuredGraph graph = parseGraph(method, args);
-
-                if (args == null) {
-                    // Cannot have a finalized version of a graph in the cache
-                    graph = graph.copy();
-                }
+                assert method.hasBytecodes() : method;
+                StructuredGraph graph = buildInitialGraph(method, args);
 
                 finalizeGraph(graph);
 
@@ -551,21 +542,6 @@
             return false;
         }
 
-        private StructuredGraph parseGraph(final ResolvedJavaMethod methodToParse, Object[] args) {
-            assert methodToParse.hasBytecodes() : methodToParse;
-            if (args != null) {
-                return buildInitialGraph(methodToParse, args);
-            }
-            StructuredGraph graph = replacements.graphCache.get(methodToParse);
-            if (graph == null) {
-                StructuredGraph newGraph = buildInitialGraph(methodToParse, args);
-                replacements.graphCache.putIfAbsent(methodToParse, newGraph);
-                graph = replacements.graphCache.get(methodToParse);
-                assert graph != null;
-            }
-            return graph;
-        }
-
         /**
          * Builds the initial graph for a snippet.
          */