diff options
author | Mathieu Chartier <mathieuc@google.com> | 2014-09-25 15:27:43 -0700 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2014-09-25 15:27:43 -0700 |
commit | 4838d6651eab0e8c0687ba44ce38e83b4553a4e2 (patch) | |
tree | 2bb025e19069f57c4a7a4d350daad6213dbc9ce5 /runtime/indirect_reference_table-inl.h | |
parent | 1ed5b27ee329208fd8ae22b8a9a61d708e2c1ffb (diff) | |
download | art-4838d6651eab0e8c0687ba44ce38e83b4553a4e2.tar.gz art-4838d6651eab0e8c0687ba44ce38e83b4553a4e2.tar.bz2 art-4838d6651eab0e8c0687ba44ce38e83b4553a4e2.zip |
Reduce IndirectReferenceTable memory usage
Changed the slot side table and the main table to be a single
table, reduced number of slots per reference from 4 to 3 to make
the IrtEntry a power of 2 size.
Before:
20848 kB: Dalvik Other
After:
16760 kB: Dalvik Other
Bug: 17643507
(cherry picked from commit a1de6b93426cfc66a64eb1b57303348aab5e766d)
Change-Id: I362475235a887c60eff6870bb10051a6be3d5814
Diffstat (limited to 'runtime/indirect_reference_table-inl.h')
-rw-r--r-- | runtime/indirect_reference_table-inl.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/indirect_reference_table-inl.h b/runtime/indirect_reference_table-inl.h index 9ee6d897ab..7e770f64a9 100644 --- a/runtime/indirect_reference_table-inl.h +++ b/runtime/indirect_reference_table-inl.h @@ -47,7 +47,7 @@ inline bool IndirectReferenceTable::GetChecked(IndirectRef iref) const { AbortIfNoCheckJNI(); return false; } - if (UNLIKELY(table_[idx].IsNull())) { + if (UNLIKELY(table_[idx].GetReference()->IsNull())) { LOG(ERROR) << "JNI ERROR (app bug): accessed deleted " << kind_ << " " << iref; AbortIfNoCheckJNI(); return false; @@ -77,7 +77,7 @@ inline mirror::Object* IndirectReferenceTable::Get(IndirectRef iref) const { return nullptr; } uint32_t idx = ExtractIndex(iref); - mirror::Object* obj = table_[idx].Read<kReadBarrierOption>(); + mirror::Object* obj = table_[idx].GetReference()->Read<kWithoutReadBarrier>(); VerifyObject(obj); return obj; } |