summaryrefslogtreecommitdiff
path: root/runtime/class_table.cc
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2016-11-16 16:22:37 -0800
committer Mathieu Chartier <mathieuc@google.com> 2016-11-21 10:05:03 -0800
commit1b868498a176705b867e2572cc1bcbd58dbd62d6 (patch)
tree36e10d1cff265d54090571ab08ad2ae9ebda97c1 /runtime/class_table.cc
parentdac7ad17c78387d15d7aefae0f852dddf5f37e34 (diff)
Use type lookup tables in compiler
This recently regressed and stopped happening, the fix creates fake OatDexFiles so that the compiler uses the type lookup tables instead of slow FindClassDef and FindTypeId. Perf on host compile Facebook: Before: 2.49%: art::DexFile::FindClassDef(unsigned short) const 1.59%: art::DexFile::FindTypeId(char const*) const After: 0.42%: art::OatDexFile::FindClassDef(art::DexFile const&, char const*, unsigned long) 0%: art::DexFile::FindTypeId(char const*) const 0%: art::DexFile::FindClassDef(unsigned short) const Average install (N6P 960 mhz average of 40 samples): 38.2s -> 35.64s Bug: 32641252 Test: test-art-host, adb install. Change-Id: I34df21dc2c155bc2579c5cafdd91f9cb0fead1a9
Diffstat (limited to 'runtime/class_table.cc')
-rw-r--r--runtime/class_table.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/class_table.cc b/runtime/class_table.cc
index b44104e299..0fcce6b307 100644
--- a/runtime/class_table.cc
+++ b/runtime/class_table.cc
@@ -170,7 +170,7 @@ bool ClassTable::InsertStrongRoot(ObjPtr<mirror::Object> obj) {
const DexFile* dex_file = ObjPtr<mirror::DexCache>::DownCast(obj)->GetDexFile();
if (dex_file != nullptr && dex_file->GetOatDexFile() != nullptr) {
const OatFile* oat_file = dex_file->GetOatDexFile()->GetOatFile();
- if (!oat_file->GetBssGcRoots().empty()) {
+ if (oat_file != nullptr && !oat_file->GetBssGcRoots().empty()) {
InsertOatFileLocked(oat_file); // Ignore return value.
}
}