diff options
| author | 2018-03-29 10:27:56 +0100 | |
|---|---|---|
| committer | 2018-03-29 10:31:49 +0100 | |
| commit | 8068bc3bc68e9560cc4650c6fb261ec9b8648fbd (patch) | |
| tree | 2bc3ac0528454869321384615d7d3951faebf2e6 | |
| parent | b38988a227534ae17045dadedc24d2131d59b42d (diff) | |
Force JIT compilation in 680-checker-deopt-dex-pc-0.
Do not rely on reaching the JIT threshold as this can
take a long time and time out on heavily loaded hosts.
Test: testrunner.py --host -t 680-checker-deopt-dex-pc-0 \
--runtime-option:-Xjitthreshold:0
Bug: 62611253
Change-Id: Ib180b61744e832779e577c86a39b476cb3856198
| -rw-r--r-- | test/680-checker-deopt-dex-pc-0/src/Main.java | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/test/680-checker-deopt-dex-pc-0/src/Main.java b/test/680-checker-deopt-dex-pc-0/src/Main.java index d5a6a9015c..64a3cb3da7 100644 --- a/test/680-checker-deopt-dex-pc-0/src/Main.java +++ b/test/680-checker-deopt-dex-pc-0/src/Main.java @@ -31,15 +31,12 @@ public class Main { System.loadLibrary(args[0]); if (hasJit()) { byte[] array = { 0, 1, 2, 3 }; - while (!hasJitCompiledEntrypoint(Main.class, "$noinline$getInt")) { - for (int i = 0; i < 10000; ++i) { - if ($noinline$getInt(array, 0) != 0x03020100) { - throw new Error(); - } - } - try { - Thread.sleep(200); - } catch (InterruptedException ignored) {} + ensureJitCompiled(Main.class, "$noinline$getInt"); + if (!hasJitCompiledEntrypoint(Main.class, "$noinline$getInt")) { + throw new Error("Unexpected entrypoint!"); + } + if ($noinline$getInt(array, 0) != 0x03020100) { + throw new Error(); } try { // The HDeoptimize at dex pc 0 was previously handled poorly as the dex pc 0 @@ -56,4 +53,5 @@ public class Main { public static native boolean hasJit(); public native static boolean hasJitCompiledEntrypoint(Class<?> cls, String methodName); + public native static void ensureJitCompiled(Class<?> cls, String methodName); } |