# HG changeset patch # User Christian Humer # Date 1414413741 -3600 # Node ID 850b874592fad50fc77f501ad411f90a4d91d947 # Parent ff1f1481b36706dfa1983bcd04f65ebb13c20815 Truffle: factor out assumption invalidate into a truffle boundary. diff -r ff1f1481b367 -r 850b874592fa graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedAssumption.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedAssumption.java Thu Oct 30 18:14:41 2014 +0100 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedAssumption.java Mon Oct 27 13:42:21 2014 +0100 @@ -30,6 +30,7 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.debug.*; +import com.oracle.truffle.api.CompilerDirectives.*; import com.oracle.truffle.api.impl.*; import com.oracle.truffle.api.nodes.*; @@ -57,27 +58,31 @@ @Override public synchronized void invalidate() { if (isValid) { - boolean invalidatedInstalledCode = false; - Entry e = first; - while (e != null) { - InstalledCode installedCode = e.installedCode.get(); - if (installedCode != null && installedCode.getVersion() == e.version) { - installedCode.invalidate(); + invalidateImpl(); + } + } - invalidatedInstalledCode = true; - if (TraceTruffleAssumptions.getValue()) { - logInvalidatedInstalledCode(installedCode); - } + @TruffleBoundary + private void invalidateImpl() { + boolean invalidatedInstalledCode = false; + Entry e = first; + while (e != null) { + InstalledCode installedCode = e.installedCode.get(); + if (installedCode != null && installedCode.getVersion() == e.version) { + installedCode.invalidate(); + invalidatedInstalledCode = true; + if (TraceTruffleAssumptions.getValue()) { + logInvalidatedInstalledCode(installedCode); } - e = e.next; } - first = null; - isValid = false; + e = e.next; + } + first = null; + isValid = false; - if (TraceTruffleAssumptions.getValue()) { - if (invalidatedInstalledCode) { - logStackTrace(); - } + if (TraceTruffleAssumptions.getValue()) { + if (invalidatedInstalledCode) { + logStackTrace(); } } }