Partly for historical reasons, we use our own built-in assertion facility rather than the one that appeared in Sun®'s JDK 1.4. All assertion checks have one of the two forms:
VM.VerifyAssertions is a
public static final field. The
config.assertions configuration variable determines
VM.VerifyAssertions' value. If
config.assertions is set to
none, Jikes RVM has no assertion overhead.
If you use the form without a message, then the default message "
vm internal error at:" will appear.
If you use the form with a message the message must be a single string literal. Doing string appends in assertions can be a source of horrible performance problems when assertions are enabled (i.e. most development builds). If you want to provide a more detailed error message when the assertion fails, then you must use the following coding pattern:
An assertion failure is always followed by a stack dump.