Skip to content

Commit

Permalink
Support assert with message
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Rogers committed Jun 28, 2009
1 parent db15c7c commit 90e921a
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,18 @@ public static void opt_assert(boolean b) {
}
}

/**
* Opt assertion failure that will also dump IR
*/
public static void opt_assert(boolean b, String message) {
if (!VM.VerifyAssertions) {
throw new Error("Assertion should have been guard by VM.VerifyAssertions");
}
if (!b) {
throw new OptimizingCompilerException("Assertion failure - "+message);
}
}

/**
* Return a string that is the printout of level stackframes in the stacktrace.
* @param level the number of levels to print
Expand Down

0 comments on commit 90e921a

Please sign in to comment.