changeset 18143:0e1c92b8b267

TruffleCache: avoid publishing invalid cache state.
author Bernhard Urban <bernhard.urban@jku.at>
date Tue, 21 Oct 2014 16:24:53 +0200
parents a94e85e5256b
children 70077134cabc
files graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCacheImpl.java
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCacheImpl.java	Tue Oct 21 16:22:38 2014 +0200
+++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCacheImpl.java	Tue Oct 21 16:24:53 2014 +0200
@@ -117,16 +117,16 @@
             }
         }
         StructuredGraph resultGraph = cache.get(key);
+        if (resultGraph == markerGraph) {
+            // Avoid recursive inlining or a previous attempt bailed out (and we won't try again).
+            return null;
+        }
+
         if (resultGraph != null) {
             lastUsed.put(key, counter++);
             return resultGraph;
         }
 
-        if (resultGraph == markerGraph) {
-            // Avoid recursive inline.
-            return null;
-        }
-
         if (lastUsed.values().size() >= TruffleCompilerOptions.TruffleMaxCompilationCacheSize.getValue()) {
             lookupExceedsMaxSize();
         }