Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: improved example for detailed error messages; mentioned extreme assertions; formatting

...

No Format
if (VM.VerifyAssertions)  VM._assert(condition)
    if (VM.VerifyAssertions)  VM._assert(condition,  message)

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.

...

No Format
if (VM.VerifyAssertions &&  condition) {
  ... build message ...
  VM._assert(falseVM.NOT_REACHED,  message);
}

An assertion failure is always followed by a stack dump.

Use VM.ExtremeAssertions instead of VM.VerifyAssertions if the assertion is costly to check but generally useful. These kinds of assertions are only enabled when config.assertions is set to extreme.