Skip to content

Commit

Permalink
Use the more descriptive opt_assert for when things go wrong.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Rogers committed Jun 27, 2009
1 parent bb4b16c commit d9d751f
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import java.io.PrintWriter;
import java.io.StringWriter;
import org.jikesrvm.VM;
import org.jikesrvm.classloader.TypeReference;

/**
Expand Down Expand Up @@ -202,6 +203,18 @@ public static void TODO(String module) throws OptimizingCompilerException {
throw new OptimizingCompilerException(module, "Unsupported function in IA32 port");
}

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

/**
* 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 d9d751f

Please sign in to comment.