Revert "Add tests around deoptimization." am: fb7730197a am: 4c664251ea am: 242c32df9e
Original change: https://android-review.googlesource.com/c/platform/art/+/2104304
Change-Id: Ie37ce388164d304c12108ff80c81614953e351ee
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/test/837-deopt/expected-stderr.txt b/test/837-deopt/expected-stderr.txt
deleted file mode 100644
index e69de29..0000000
--- a/test/837-deopt/expected-stderr.txt
+++ /dev/null
diff --git a/test/837-deopt/expected-stdout.txt b/test/837-deopt/expected-stdout.txt
deleted file mode 100644
index 6a5618e..0000000
--- a/test/837-deopt/expected-stdout.txt
+++ /dev/null
@@ -1 +0,0 @@
-JNI_OnLoad called
diff --git a/test/837-deopt/info.txt b/test/837-deopt/info.txt
deleted file mode 100644
index 5c95277..0000000
--- a/test/837-deopt/info.txt
+++ /dev/null
@@ -1 +0,0 @@
-Tests around deoptimization.
diff --git a/test/837-deopt/src/Main.java b/test/837-deopt/src/Main.java
deleted file mode 100644
index 93efff9..0000000
--- a/test/837-deopt/src/Main.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-class Main {
- int field = 42;
-
- // Test that deoptimization preserves objects that are singletons.
- public static int $noinline$foo(Main arg) {
- Main m = new Main();
- arg.returnValue();
- return m.field;
- }
-
- // Test that doing OSR after deoptimization works.
- public static int $noinline$foo2(Main arg, boolean osr) {
- Main m = new Main();
- arg.returnValue();
- if (osr) {
- for (int i = 0; i < Integer.MAX_VALUE; i++) {}
- }
- return m.field;
- }
-
- public static void main(String[] args) throws Throwable {
- System.loadLibrary(args[0]);
- test1();
- test2();
- }
-
- public static void assertEquals(int expected, int actual) {
- if (expected != actual) {
- throw new Error("Expected " + expected + ", got " + actual);
- }
- }
-
- public static void test1() {
- ensureJitBaselineCompiled(Main.class, "$noinline$foo");
- // Surround the call with GCs to increase chances we execute $noinline$foo
- // while the GC isn't marking. This makes sure the inline cache is populated.
- Runtime.getRuntime().gc();
- assertEquals(42, $noinline$foo(new Main()));
- Runtime.getRuntime().gc();
-
- ensureJitCompiled(Main.class, "$noinline$foo");
- assertEquals(42, $noinline$foo(new SubMain()));
- }
-
- public static void test2() {
- ensureJitBaselineCompiled(Main.class, "$noinline$foo2");
- // Surround the call with GCs to increase chances we execute $noinline$foo
- // while the GC isn't marking. This makes sure the inline cache is populated.
- Runtime.getRuntime().gc();
- assertEquals(42, $noinline$foo2(new Main(), false));
- Runtime.getRuntime().gc();
-
- ensureJitCompiled(Main.class, "$noinline$foo2");
- assertEquals(42, $noinline$foo2(new SubMain(), true));
- }
-
- public String returnValue() {
- return "Main";
- }
-
- public static native void ensureJitCompiled(Class<?> cls, String methodName);
- public static native void ensureJitBaselineCompiled(Class<?> cls, String methodName);
-}
-
-// Define a subclass with another implementation of returnValue to deoptimize $noinline$foo and
-// $noinline$foo2.
-class SubMain extends Main {
- public String returnValue() {
- return "SubMain";
- }
-}
diff --git a/test/knownfailures.json b/test/knownfailures.json
index e38ea86..013272f 100644
--- a/test/knownfailures.json
+++ b/test/knownfailures.json
@@ -1507,10 +1507,5 @@
"tests": ["2043-reference-pauses"],
"env_vars": {"ART_TEST_DEBUG_GC": "true"},
"description": ["Test timing out on debug gc."]
- },
- {
- "tests": ["837-deopt"],
- "description": ["Tests deoptimization and OSR, which never happens when tracing."],
- "variant": "trace | stream | interpreter | interp-ac"
}
]