changeset 13673:bd94d77af2c1

SpeculationLog: split maySpeculate into maySpeculate (check only) and speculate (register)
author Gilles Duboscq <duboscq@ssw.jku.at>
date Fri, 17 Jan 2014 14:07:06 +0100
parents e632118253ac
children c700811a2814
files graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/SpeculationLog.java
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/SpeculationLog.java	Fri Jan 17 14:04:41 2014 +0100
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/SpeculationLog.java	Fri Jan 17 14:07:06 2014 +0100
@@ -47,10 +47,15 @@
         }
     }
 
-    public Constant maySpeculate(Object reason) {
+    public boolean maySpeculate(Object reason) {
         if (failedSpeculations != null && failedSpeculations.contains(reason)) {
-            return null;
+            return false;
         }
+        return true;
+    }
+
+    public Constant speculate(Object reason) {
+        assert maySpeculate(reason);
         if (speculations == null) {
             synchronized (this) {
                 if (speculations == null) {