OSDN Git Service

Add hash map, reduce excessive hashing
authorMathieu Chartier <mathieuc@google.com>
Fri, 7 Nov 2014 00:35:45 +0000 (16:35 -0800)
committerMathieu Chartier <mathieuc@google.com>
Fri, 7 Nov 2014 19:45:06 +0000 (11:45 -0800)
commite7c9a8c2b8481aafbc6af4ce6229bd361ba24742
treef6d8fe8fd7aeae117a6547dc4f012cd4085cb4e8
parent00b2da5c02339c36ffa4006f731f55203b09265d
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)
13 files changed:
oatdump/oatdump.cc
runtime/base/hash_map.h [new file with mode: 0644]
runtime/base/hash_set_test.cc
runtime/class_linker.cc
runtime/class_linker.h
runtime/dex_file.cc
runtime/dex_file.h
runtime/native/dalvik_system_DexFile.cc
runtime/native/dalvik_system_VMRuntime.cc
runtime/native/java_lang_VMClassLoader.cc
runtime/utf.cc
runtime/utf.h
runtime/verifier/reg_type_cache.cc