Mercurial > hg > graal-jvmci-8
diff graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/builtins/SLAssertFalseBuiltin.java @ 17004:158c9ba66e45
SL: added support for guest language stack traces to SLException; added SLAssertionError.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Mon, 01 Sep 2014 20:08:18 +0200 |
parents | 8fd42ea95f64 |
children |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/builtins/SLAssertFalseBuiltin.java Mon Sep 01 20:08:18 2014 +0200 +++ b/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/builtins/SLAssertFalseBuiltin.java Mon Sep 01 20:08:18 2014 +0200 @@ -26,6 +26,7 @@ import com.oracle.truffle.api.dsl.*; import com.oracle.truffle.api.nodes.*; import com.oracle.truffle.api.source.*; +import com.oracle.truffle.sl.*; import com.oracle.truffle.sl.runtime.*; /** @@ -43,11 +44,7 @@ public boolean doAssert(boolean value, String message) { if (value) { CompilerDirectives.transferToInterpreter(); - if (message == null) { - throw new AssertionError(); - } else { - throw new AssertionError(message); - } + throw new SLAssertionError(message == null ? "" : message); } return value; }