# HG changeset patch # User Christian Humer # Date 1426510065 -3600 # Node ID f803f49c9ec423cb1c87a510c29fd61afd6a8c57 # Parent 89c729e9e0a4d859f1b78c18b82c8907388590e9 Truffle: fixed TruffleCompilationExceptionsAreThrown was ignored for non permanent bailouts. diff -r 89c729e9e0a4 -r f803f49c9ec4 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java Mon Mar 16 15:12:22 2015 +0100 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java Mon Mar 16 13:47:45 2015 +0100 @@ -344,18 +344,22 @@ } public void notifyCompilationFailed(Throwable t) { - if (!(t instanceof BailoutException) || ((BailoutException) t).isPermanent()) { + if (t instanceof BailoutException && !((BailoutException) t).isPermanent()) { + /* + * Non permanent bailouts are expected cases. A non permanent bailout would be for + * example class redefinition during code installation. As opposed to permanent + * bailouts, non permanent bailouts will trigger recompilation and are not considered a + * failure state. + */ + } else { compilationPolicy.recordCompilationFailure(t); if (TruffleCompilationExceptionsAreThrown.getValue()) { throw new OptimizationFailedException(t, this); } - } - - if (t instanceof BailoutException) { - // Bailout => move on. - } else if (TruffleCompilationExceptionsAreFatal.getValue()) { - t.printStackTrace(OUT); - System.exit(-1); + if (TruffleCompilationExceptionsAreFatal.getValue()) { + t.printStackTrace(OUT); + System.exit(-1); + } } }