# HG changeset patch # User Gilles Duboscq # Date 1389964026 -3600 # Node ID bd94d77af2c1fd0f8d89034f75a904e18f58bc4c # Parent e632118253ac56a689bd4cedcf8be5659e6e04dd SpeculationLog: split maySpeculate into maySpeculate (check only) and speculate (register) diff -r e632118253ac -r bd94d77af2c1 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/SpeculationLog.java --- 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) {