# HG changeset patch # User Lukas Stadler # Date 1404482804 -7200 # Node ID ed91068c8af5ca34f04fe8ad73810bc79705ea80 # Parent 9bfc4247262f2f4d742c8c46d1641fc1c34e65c2 cleanup in AssertionNode diff -r 9bfc4247262f -r ed91068c8af5 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotHostForeignCallsProvider.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotHostForeignCallsProvider.java Fri Jul 04 16:06:44 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotHostForeignCallsProvider.java Fri Jul 04 16:06:44 2014 +0200 @@ -136,6 +136,10 @@ */ registerForeignCall(UNPACK_FRAMES, c.deoptimizationUnpackFrames, NativeCall, DESTROYS_REGISTERS, LEAF, NOT_REEXECUTABLE, ANY_LOCATION); + /* + * This message call is registered twice, where the second one must only be used for calls + * that do not return, i.e., that exit the VM. + */ registerForeignCall(VM_MESSAGE_C, c.vmMessageAddress, NativeCall, DESTROYS_REGISTERS, NOT_LEAF, REEXECUTABLE, NO_LOCATIONS); registerForeignCall(ASSERTION_VM_MESSAGE_C, c.vmMessageAddress, NativeCall, PRESERVES_REGISTERS, LEAF, REEXECUTABLE, NO_LOCATIONS); diff -r 9bfc4247262f -r ed91068c8af5 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/AssertionNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/AssertionNode.java Fri Jul 04 16:06:44 2014 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/AssertionNode.java Fri Jul 04 16:06:44 2014 +0200 @@ -61,6 +61,10 @@ if (value.isConstant() && value.asConstant().asInt() != 0) { return null; } + /* + * Assertions with a constant "false" value do not immediately cause an error, since they + * may be unreachable and could thus be removed by later optimizations. + */ return this; } @@ -73,9 +77,9 @@ public void generate(NodeLIRBuilderTool generator) { assert compileTimeAssertion; if (value.isConstant() && value.asConstant().asInt() == 0) { - throw new GraalInternalError("failed compile-time assertion: %s", message); + throw new GraalInternalError("%s: failed compile-time assertion: %s", this, message); } else { - throw new GraalInternalError("failed compile-time assertion (value %s): %s", value, message); + throw new GraalInternalError("%s: failed compile-time assertion (value %s): %s", this, value, message); } }