From 2ba6ff25938e6f1755748a4c7ef3ad0b45be6df7 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Wed, 8 Jan 2020 14:47:26 +0000 Subject: Fix String.init tests with baseline JIT. Baseline JIT doesn't do deoptimizations, but the test assumes compiled code will. Adjust the test to call ensureJitCompiled to force non-baseline compilation. Test: testrunner.py --host --64 --jit -t 563 -t 575 Bug: 147209001 Change-Id: I062650e07616610b01415e3add193687fcc35e30 --- test/575-checker-string-init-alias/src/Main.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/575-checker-string-init-alias/src/Main.java') diff --git a/test/575-checker-string-init-alias/src/Main.java b/test/575-checker-string-init-alias/src/Main.java index 1ab320748a..b55b0c5ad8 100644 --- a/test/575-checker-string-init-alias/src/Main.java +++ b/test/575-checker-string-init-alias/src/Main.java @@ -23,6 +23,7 @@ public class Main { class Inner {} public static native void assertIsInterpreted(); + public static native void ensureJitCompiled(Class cls, String methodName); private static void assertEqual(String expected, String actual) { if (!expected.equals(actual)) { @@ -36,6 +37,8 @@ public class Main { int[] array = new int[1]; { + // If the JIT is enabled, ensure it has compiled the method to force the deopt. + ensureJitCompiled(c, "testNoAlias"); Method m = c.getMethod("testNoAlias", int[].class, String.class); try { m.invoke(null, new Object[] { array , "foo" }); @@ -51,6 +54,8 @@ public class Main { } { + // If the JIT is enabled, ensure it has compiled the method to force the deopt. + ensureJitCompiled(c, "testAlias"); Method m = c.getMethod("testAlias", int[].class, String.class); try { m.invoke(null, new Object[] { array, "bar" }); -- cgit v1.2.3-59-g8ed1b