// This test checks that FP registers spill offset is correctly recorded in the SlowPath; by causing // asynchronous deoptimization in debuggable mode we observe the FP values in the interpreter. publicclass FloatLoop implements Runnable { staticfinalint numberOfThreads = 2; volatilestaticboolean sExitFlag = false; volatilestaticboolean sEntered = false; int threadIndex;
FloatLoop(int index) {
threadIndex = index;
}
publicstaticvoid main() throws Exception { finalThread[] threads = newThread[numberOfThreads]; for (int t = 0; t < threads.length; t++) {
threads[t] = newThread(new FloatLoop(t));
threads[t].start();
} for (Thread t : threads) {
t.join();
}
// Create an empty int[] to force loading the int[] class before compiling $noinline$busyLoop. // This makes sure the compiler can properly type int[] and not bail. staticint[] emptyArray = newint[0];
// On Arm64: // This loop is likely to be vectorized which causes the full 16-byte Q-register to be saved // across slow paths. int[] array = newint[kArraySize]; for (int i = 0; i < kArraySize; i++) {
array[i]++;
}
sEntered = true; float s0 = kFloatConst0; float s1 = kFloatConst1; for (int i = 0; !sExitFlag; i++) { if (i % 2 == 0) {
s0 += 2.0;
s1 += 2.0;
} else {
s0 -= 2.0;
s1 -= 2.0;
} // SuspendCheckSlowPath must record correct stack offset for spilled FP registers.
}
Main.assertIsInterpreted();
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.