Add some debugging code in jit code cache.
To help debug:
https://ci.chromium.org/ui/p/art/builders/ci/host-x86_64-non-gen-cc/5620/overview
Test: test.py
Change-Id: Ieedb66638c131ef1806f6b201d06fc403b7239a0
diff --git a/runtime/jit/jit_code_cache.cc b/runtime/jit/jit_code_cache.cc
index 34f9045..aae923a 100644
--- a/runtime/jit/jit_code_cache.cc
+++ b/runtime/jit/jit_code_cache.cc
@@ -1425,7 +1425,14 @@
ArtMethod* found_method = nullptr; // Only for DCHECK(), not for JNI stubs.
if (method != nullptr && UNLIKELY(method->IsNative())) {
auto it = jni_stubs_map_.find(JniStubKey(method));
- if (it == jni_stubs_map_.end() || !ContainsElement(it->second.GetMethods(), method)) {
+ if (it == jni_stubs_map_.end()) {
+ return nullptr;
+ }
+ if (!ContainsElement(it->second.GetMethods(), method)) {
+ DCHECK(!OatQuickMethodHeader::FromCodePointer(it->second.GetCode())->Contains(pc))
+ << "Method missing from stub map, but pc executing the method points to the stub."
+ << " method= " << method->PrettyMethod()
+ << " pc= " << std::hex << pc;
return nullptr;
}
const void* code_ptr = it->second.GetCode();