ART: Improve the timings for 597-deopt-busy-loop.
Tweak the timings to have the deoptimization to happen
in the SIMD loop SuspendCheck as intended (after the array size
was changed).
Test: 597-deopt-busy-loop.
Change-Id: Idc519b3e27d2398ab393b66ba555c089629388b1
diff --git a/test/597-deopt-busy-loop/src/SimdLoop.java b/test/597-deopt-busy-loop/src/SimdLoop.java
index 3acf151..4ad8858 100644
--- a/test/597-deopt-busy-loop/src/SimdLoop.java
+++ b/test/597-deopt-busy-loop/src/SimdLoop.java
@@ -55,8 +55,19 @@
sEntered = true;
// On Arm64:
- // This loop is likely to be vectorized; when deoptimizing to interpreter the induction
+ // These loops are likely to be vectorized; when deoptimizing to interpreter the induction
// variable i will be set to wrong value (== 0).
+ //
+ // Copy-paste instead of nested loop is here to avoid extra loop suspend check.
+ for (int i = 0; i < kArraySize; i++) {
+ array[i]++;
+ }
+ for (int i = 0; i < kArraySize; i++) {
+ array[i]++;
+ }
+ for (int i = 0; i < kArraySize; i++) {
+ array[i]++;
+ }
for (int i = 0; i < kArraySize; i++) {
array[i]++;
}
@@ -65,10 +76,9 @@
if (sExitFlag) {
Main.assertIsInterpreted();
}
-
// Regression: the value of the induction variable might have been set to 0 when
// deoptimizing causing to have another array[0]++.
- expectEqual(array[0], 1);
+ expectEqual(array[0], 4);
}
public void run() {
@@ -77,12 +87,6 @@
Thread.yield();
}
- try {
- Thread.sleep(1L);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
-
Main.deoptimizeAll();
sExitFlag = true;
} else {