summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2015-08-27 10:17:28 -0700
committer Mathieu Chartier <mathieuc@google.com> 2015-08-27 10:18:31 -0700
commit5af910615a4b99eb7f493465bf3d42558c596237 (patch)
treedfacd9131052f1ae3ecf6b4603ebce0cbcad9237
parent4dce334b93596327433ba65c98d08960514d942f (diff)
Re-add location check for FindDexCache
Fixes oatdump test. Bug: 22720414 Change-Id: I4a7622ab9e47893deaea2c100fabfa1f3386a4bc
-rw-r--r--runtime/class_linker.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index 3b505e6bf9..a722fa8e1d 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -2540,10 +2540,17 @@ mirror::DexCache* ClassLinker::FindDexCacheLocked(const DexFile& dex_file, bool
return dex_cache;
}
}
+ // Check dex file by location, this is used for oatdump.
+ std::string location(dex_file.GetLocation());
+ for (jobject weak_root : dex_caches_) {
+ mirror::DexCache* dex_cache = down_cast<mirror::DexCache*>(self->DecodeJObject(weak_root));
+ if (dex_cache != nullptr && dex_cache->GetDexFile()->GetLocation() == location) {
+ return dex_cache;
+ }
+ }
if (allow_failure) {
return nullptr;
}
- std::string location(dex_file.GetLocation());
// Failure, dump diagnostic and abort.
for (jobject weak_root : dex_caches_) {
mirror::DexCache* dex_cache = down_cast<mirror::DexCache*>(self->DecodeJObject(weak_root));