Fix JIT for vmdebug test 99
Test was flaky due to JIT re-compiliation after deoptimization
resulting in some invalid PC offsets.
Bug: 17950037
Change-Id: I276c84c918579259ce47ef873892c3c5dcf0c977
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index f28253a..ee5eefb 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -2520,16 +2520,16 @@
return GetQuickProxyInvokeHandler();
}
bool found;
- jit::Jit* const jit = Runtime::Current()->GetJit();
- if (jit != nullptr) {
- auto* code = jit->GetCodeCache()->GetCodeFor(method);
+ OatFile::OatMethod oat_method = FindOatMethodFor(method, &found);
+ if (found) {
+ auto* code = oat_method.GetQuickCode();
if (code != nullptr) {
return code;
}
}
- OatFile::OatMethod oat_method = FindOatMethodFor(method, &found);
- if (found) {
- auto* code = oat_method.GetQuickCode();
+ jit::Jit* const jit = Runtime::Current()->GetJit();
+ if (jit != nullptr) {
+ auto* code = jit->GetCodeCache()->GetCodeFor(method);
if (code != nullptr) {
return code;
}
@@ -2545,6 +2545,11 @@
if (method->IsNative() || method->IsAbstract() || method->IsProxyMethod()) {
return nullptr;
}
+ bool found;
+ OatFile::OatMethod oat_method = FindOatMethodFor(method, &found);
+ if (found) {
+ return oat_method.GetQuickCode();
+ }
jit::Jit* jit = Runtime::Current()->GetJit();
if (jit != nullptr) {
auto* code = jit->GetCodeCache()->GetCodeFor(method);
@@ -2552,11 +2557,6 @@
return code;
}
}
- bool found;
- OatFile::OatMethod oat_method = FindOatMethodFor(method, &found);
- if (found) {
- return oat_method.GetQuickCode();
- }
return nullptr;
}