diff options
author | Mathieu Chartier <mathieuc@google.com> | 2014-11-06 16:35:45 -0800 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2014-11-07 11:45:06 -0800 |
commit | e7c9a8c2b8481aafbc6af4ce6229bd361ba24742 (patch) | |
tree | f6d8fe8fd7aeae117a6547dc4f012cd4085cb4e8 /oatdump | |
parent | 00b2da5c02339c36ffa4006f731f55203b09265d (diff) | |
download | art-e7c9a8c2b8481aafbc6af4ce6229bd361ba24742.zip art-e7c9a8c2b8481aafbc6af4ce6229bd361ba24742.tar.gz art-e7c9a8c2b8481aafbc6af4ce6229bd361ba24742.tar.bz2 |
Add hash map, reduce excessive hashing
Changed the class def index to use a HashMap instead of unordered_map
so that we can use FindWithHash to reduce how often we need to compute
hashes.
Fixed a bug in ClassLinker::UpdateClass where we didn't properly
handle classes with the same descriptor but different class loaders.
Introduced by previous CL.
Before (fb launch):
1.74% art::ComputeModifiedUtf8Hash(char const*)
After:
0.95% art::ComputeModifiedUtf8Hash(char const*)
Bug: 18054905
Bug: 16828525
Change-Id: Iba2ee37c9837289e0ea187800ba4af322225a994
(cherry picked from commit 564ff985184737977aa26c485d0c1a413e530705)
Diffstat (limited to 'oatdump')
-rw-r--r-- | oatdump/oatdump.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/oatdump/oatdump.cc b/oatdump/oatdump.cc index dca048f..cdf48c3 100644 --- a/oatdump/oatdump.cc +++ b/oatdump/oatdump.cc @@ -520,8 +520,9 @@ class OatDumper { LOG(WARNING) << "Failed to open dex file '" << oat_dex_file->GetDexFileLocation() << "': " << error_msg; } else { + const char* descriptor = m->GetDeclaringClassDescriptor(); const DexFile::ClassDef* class_def = - dex_file->FindClassDef(m->GetDeclaringClassDescriptor()); + dex_file->FindClassDef(descriptor, ComputeModifiedUtf8Hash(descriptor)); if (class_def != nullptr) { uint16_t class_def_index = dex_file->GetIndexForClassDef(*class_def); const OatFile::OatClass oat_class = oat_dex_file->GetOatClass(class_def_index); |