publicstaticvoid main(String[] args) throws Exception {
System.loadLibrary(args[0]); Class<?> cls = classFromDifferentLoader();
Method m = cls.getDeclaredMethod("letMeInlineYou", A.class);
B b = new B(); // Invoke the method enough times to get an inline cache and get JITted. for (int i = 0; i < 10000; ++i) {
m.invoke(null, b);
}
m = cls.getDeclaredMethod("areYouB", null);
ClassLoader loader = (ClassLoader) m.invoke(null); if (loader != cls.getClassLoader()) { thrownew Error("Wrong class loader");
}
}
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.