diff options
author | 2021-02-23 18:13:47 +0000 | |
---|---|---|
committer | 2021-03-04 11:30:53 +0000 | |
commit | 4e7b3c78854d9639758e2519ae29f86a6799857b (patch) | |
tree | 287f5211900b53e22f64f3364bd3cc44ce78e87a /runtime/class_table.cc | |
parent | 18839fe532ceae55e5cb6ae98b5aecb4217623fa (diff) |
Make some hash/equals operators inline.
Namely class descriptor hash/equals in ClassTable and
string hash/equals in InternTable.
This should reduce reliance on ThinLTO for performance.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 179799979
Bug: 179837605
Change-Id: Ie513b2312d30e1b52efefd705a26d13035789e4a
Diffstat (limited to 'runtime/class_table.cc')
-rw-r--r-- | runtime/class_table.cc | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/runtime/class_table.cc b/runtime/class_table.cc index fc2640c2cc..288e312bb1 100644 --- a/runtime/class_table.cc +++ b/runtime/class_table.cc @@ -164,44 +164,6 @@ bool ClassTable::Remove(const char* descriptor) { return false; } -uint32_t ClassTable::ClassDescriptorHash::operator()(const TableSlot& slot) - const { - std::string temp; - // No read barrier needed, we're reading a chain of constant references for comparison - // with null and retrieval of constant primitive data. See ReadBarrierOption. - return ComputeModifiedUtf8Hash(slot.Read<kWithoutReadBarrier>()->GetDescriptor(&temp)); -} - -uint32_t ClassTable::ClassDescriptorHash::operator()(const DescriptorHashPair& pair) const { - DCHECK_EQ(ComputeModifiedUtf8Hash(pair.first), pair.second); - return pair.second; -} - -bool ClassTable::ClassDescriptorEquals::operator()(const TableSlot& a, const TableSlot& b) const { - // No read barrier needed, we're reading a chain of constant references for comparison - // with null and retrieval of constant primitive data. See ReadBarrierOption. - if (a.Hash() != b.Hash()) { - std::string temp; - DCHECK(!a.Read<kWithoutReadBarrier>()->DescriptorEquals( - b.Read<kWithoutReadBarrier>()->GetDescriptor(&temp))); - return false; - } - std::string temp; - return a.Read<kWithoutReadBarrier>()->DescriptorEquals( - b.Read<kWithoutReadBarrier>()->GetDescriptor(&temp)); -} - -bool ClassTable::ClassDescriptorEquals::operator()(const TableSlot& a, - const DescriptorHashPair& b) const { - // No read barrier needed, we're reading a chain of constant references for comparison - // with null and retrieval of constant primitive data. See ReadBarrierOption. - if (!a.MaskedHashEquals(b.second)) { - DCHECK(!a.Read<kWithoutReadBarrier>()->DescriptorEquals(b.first)); - return false; - } - return a.Read<kWithoutReadBarrier>()->DescriptorEquals(b.first); -} - bool ClassTable::InsertStrongRoot(ObjPtr<mirror::Object> obj) { WriterMutexLock mu(Thread::Current(), lock_); DCHECK(obj != nullptr); |