// Ensure that the "loop" method is compiled. Otherwise we currently have no real way to get rid // of dead references. Return true if it looks like we succeeded. publicstaticboolean ensureCompiled(Class cls, String methodName) throws NoSuchMethodException {
Method m = cls.getDeclaredMethod(methodName); if (isAotCompiled(cls, methodName)) { returntrue;
} else {
ensureMethodJitCompiled(m); if (hasJitCompiledEntrypoint(cls, methodName)) { returntrue;
} returnfalse;
}
}
// Garbage collect and check that the atomic counter has the expected value. // Exped value of -1 means don't care. // Noinline because we don't want the inlining here to interfere with the ReachabilitySensitive // analysis. publicstaticvoid $noinline$gcAndCheck(AtomicInteger counter, int expected, String label,
String msg) {
Runtime.getRuntime().gc();
System.runFinalization(); int count = counter.get();
System.out.println(label + " count: " + count); if (counter.get() != expected && expected != -1) {
System.out.println(msg);
}
}
publicstaticvoid main(String[] args) {
System.loadLibrary(args[0]); // Run several variations of the same test with different reachability annotations, etc. // Only the DeadReferenceSafeTest should finalize every previously allocated object.
DeadReferenceUnsafeTest.runTest();
DeadReferenceSafeTest.runTest();
ReachabilitySensitiveTest.runTest();
ReachabilitySensitiveFunTest.runTest();
ReachabilityFenceTest.runTest();
} publicstaticnativevoid ensureMethodJitCompiled(Method meth); publicstaticnativeboolean hasJitCompiledEntrypoint(Class<?> cls, String methodName); publicstaticnativeboolean isAotCompiled(Class<?> cls, String methodName);
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.14 Sekunden
(vorverarbeitet am 2026-06-29)
¤
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.