Try really hard for JIT in test 916
Sometimes we would fail to jit stuff due to high load. This makes us
try even harder to JIT so we won't fail in these scenarios.
Test: mma -j40 test-art-host
Test: stress --cpu 60 &; while ./test/run-test --host 916; do ; done
Change-Id: Ic944582bf021f119b8bc3f135af508ed8a8586c4
diff --git a/test/common/runtime_state.cc b/test/common/runtime_state.cc
index 7451cf9..271657f 100644
--- a/test/common/runtime_state.cc
+++ b/test/common/runtime_state.cc
@@ -152,7 +152,12 @@
jclass,
jclass cls,
jstring method_name) {
- jit::Jit* jit = Runtime::Current()->GetJit();
+ Runtime* runtime = Runtime::Current();
+ if (runtime == nullptr) {
+ // We must be on the RI. We will just roll with it.
+ return;
+ }
+ jit::Jit* jit = runtime->GetJit();
if (jit == nullptr) {
return;
}
@@ -166,6 +171,11 @@
CHECK(chars.c_str() != nullptr);
method = soa.Decode<mirror::Class>(cls)->FindDeclaredDirectMethodByName(
chars.c_str(), kRuntimePointerSize);
+ if (method == nullptr) {
+ method = soa.Decode<mirror::Class>(cls)->FindDeclaredVirtualMethodByName(
+ chars.c_str(), kRuntimePointerSize);
+ }
+ DCHECK(method != nullptr) << "Unable to find method called " << chars.c_str();
}
jit::JitCodeCache* code_cache = jit->GetCodeCache();