Fix CHA test failures under some configurations.
Some checks in IsManaged() are outdated.
Bug: 36344221
Test: m -j20 test-art-host-run-test
Test: test-art-host-run-test-debug-no-dex2oat-jit-no-relocate-ntrace-cms-checkjni-picimage-npictest-ndebuggable-616-cha-abstract64
Change-Id: Iec248cddf08b0a4ebce5f8fbca75d8d280797640
diff --git a/test/common/stack_inspect.cc b/test/common/stack_inspect.cc
index df7fa20..ceb4ba2 100644
--- a/test/common/stack_inspect.cc
+++ b/test/common/stack_inspect.cc
@@ -144,22 +144,11 @@
}
}
-static jboolean IsManaged(JNIEnv* env, jclass cls, size_t level) {
+static jboolean IsManaged(JNIEnv* env, jclass, size_t level) {
ScopedObjectAccess soa(env);
-
- ObjPtr<mirror::Class> klass = soa.Decode<mirror::Class>(cls);
- const DexFile& dex_file = klass->GetDexFile();
- const OatFile::OatDexFile* oat_dex_file = dex_file.GetOatDexFile();
- if (oat_dex_file == nullptr) {
- // No oat file, this must be a test configuration that doesn't compile at all. Ignore that the
- // result will be that we're running the interpreter.
- return JNI_FALSE;
- }
-
NthCallerVisitor caller(soa.Self(), level, false);
caller.WalkStack();
CHECK(caller.caller != nullptr);
-
return caller.GetCurrentShadowFrame() != nullptr ? JNI_FALSE : JNI_TRUE;
}