publicclass Main { privatestaticfinalint WALL_CLOCK_FLAG = 0x010; privatestatic File file;
publicstaticvoid main(String[] args) throws Exception {
System.loadLibrary(args[0]);
String name = System.getProperty("java.vm.name"); if (!"Dalvik".equals(name)) {
System.out.println("This test is not supported on " + name); return;
}
publicstaticvoid testTracing(boolean streaming, int flags, BaseTraceParser parser, int expected_version) throws Exception {
Main m = new Main();
Method jitMethod = Main.class.getDeclaredMethod("$noinline$doSomeWorkJIT",
FileDescriptor.class, Integer.TYPE); Thread t = newThread(() -> { try {
file = VMDebug.createTempFile();
FileOutputStream out_file = new FileOutputStream(file);
Main m1 = new Main(); try {
jitMethod.invoke(m, out_file.getFD(), flags);
} catch (Exception e) {
System.out.println("Exception " + e);
}
VMDebug.$noinline$stopMethodTracing();
out_file.close(); // Only check methods from this class. There are too many different outputs possible // if we allow all methods for configurations like debuggable / interpreter and a // combination of them.
parser.CheckTraceFileFormat(file, expected_version, "TestThread2246", "Main.java");
file.delete();
} catch (Exception e) {
System.out.println("Exception in thread " + e);
e.printStackTrace();
} finally {
file.delete();
}
}, "TestThread2246"); try { if (VMDebug.getMethodTracingMode() != 0) {
VMDebug.$noinline$stopMethodTracing();
}
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.