ART: Stop JIT in 913-heaps
To avoid any JIT interaction, stop the JIT thread pool in
test 913-heaps.
Bug: 31385354
Test: m ART_TEST_JIT=true test-art-host-run-test-913-heaps
Change-Id: I710ca0ed3736b5394863aa76aff9ea2ae7d50cb1
diff --git a/test/913-heaps/heaps.cc b/test/913-heaps/heaps.cc
index 0c627d6..49437b1 100644
--- a/test/913-heaps/heaps.cc
+++ b/test/913-heaps/heaps.cc
@@ -261,6 +261,8 @@
std::vector<std::string> lines_;
};
+ jit::ScopedJitSuspend sjs; // Wait to avoid JIT influence (e.g., JNI globals).
+
// If jniRef isn't null, add a local and a global ref.
ScopedLocalRef<jobject> jni_local_ref(env, nullptr);
jobject jni_global_ref = nullptr;
@@ -299,12 +301,5 @@
return 0;
}
-extern "C" JNIEXPORT void JNICALL Java_Main_waitForJitCompilation(JNIEnv*, jclass) {
- jit::Jit* jit = Runtime::Current()->GetJit();
- if (jit != nullptr) {
- jit->WaitForCompilationToFinish(Thread::Current());
- }
-}
-
} // namespace Test913Heaps
} // namespace art
diff --git a/test/913-heaps/src/Main.java b/test/913-heaps/src/Main.java
index fc00ada..a6ace9a 100644
--- a/test/913-heaps/src/Main.java
+++ b/test/913-heaps/src/Main.java
@@ -101,8 +101,6 @@
private static void doFollowReferencesTestImpl(A root, int stopAfter, int followSet,
Object asRoot, Verifier v, String additionalEnabled) {
- waitForJitCompilation(); // Wait to avoid JIT influence (e.g., JNI globals).
-
String[] lines =
followReferences(0, null, root, stopAfter, followSet, asRoot);
@@ -388,6 +386,4 @@
private static native String[] followReferences(int heapFilter, Class<?> klassFilter,
Object initialObject, int stopAfter, int followSet, Object jniRef);
-
- private static native void waitForJitCompilation();
}