summaryrefslogtreecommitdiff
path: root/test/575-checker-string-init-alias/src/Main.java
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2020-01-08 14:47:26 +0000
committer Nicolas Geoffray <ngeoffray@google.com> 2020-01-15 10:49:45 +0000
commit2ba6ff25938e6f1755748a4c7ef3ad0b45be6df7 (patch)
tree80d8b3f4142262c8b7099472617ae1e72eb776c5 /test/575-checker-string-init-alias/src/Main.java
parent46d7b24ddb2160123afb3facad4b54242422a45f (diff)
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
Diffstat (limited to 'test/575-checker-string-init-alias/src/Main.java')
-rw-r--r--test/575-checker-string-init-alias/src/Main.java5
1 files changed, 5 insertions, 0 deletions
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" });