publicclass Main { publicstaticclass Inner { // Use a <clinit> method to ensure we execute in the // interpreter. static {
Main.callMethodThatThrows();
}
}
publicstaticvoid main(String[] args) throws Exception {
System.loadLibrary(args[0]); // Disables use of nterp.
Main.setAsyncExceptionsThrown();
Thread.currentThread().setUncaughtExceptionHandler((th, e) -> {
System.out.println("Caught exception"); // Exit the test gracefully.
System.exit(0);
}); // This will throw at `callMethodThatThrows` and trigger deoptimization checks which we used // to crash on. new Inner();
}
publicstaticvoid callMethodThatThrows() { // Ensures we get deoptimization requests.
Main.forceInterpreterOnThread(); thrownew Error("");
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.