summaryrefslogtreecommitdiff
path: root/runtime/class_table-inl.h
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2019-04-10 11:40:01 +0100
committer Vladimir Marko <vmarko@google.com> 2019-05-08 08:19:28 +0000
commitc6934e36d33ab402b7b51c78d46c319fc33e8ef3 (patch)
treecec68ac35886015369bca93d5987889552327ac6 /runtime/class_table-inl.h
parent552ba72fce139aa2b0a80d1a2b920c5e8fadaf58 (diff)
Avoid some read barriers in ClassTable.
And clean up ClassTable. Test: m test-art-host-gtest Test: testrunner.py --host --interpreter Bug: 119486698 Change-Id: Ie413bc5a56eb548352ae1fed0976b75c44e0c0d4
Diffstat (limited to 'runtime/class_table-inl.h')
-rw-r--r--runtime/class_table-inl.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/runtime/class_table-inl.h b/runtime/class_table-inl.h
index 5f8a0b03c8..d07ad33d21 100644
--- a/runtime/class_table-inl.h
+++ b/runtime/class_table-inl.h
@@ -88,6 +88,10 @@ bool ClassTable::Visit(const Visitor& visitor) {
return true;
}
+inline bool ClassTable::TableSlot::IsNull() const {
+ return Read<kWithoutReadBarrier>() == nullptr;
+}
+
template<ReadBarrierOption kReadBarrierOption>
inline mirror::Class* ClassTable::TableSlot::Read() const {
const uint32_t before = data_.load(std::memory_order_relaxed);
@@ -127,11 +131,7 @@ inline uint32_t ClassTable::TableSlot::Encode(ObjPtr<mirror::Class> klass, uint3
inline ClassTable::TableSlot::TableSlot(ObjPtr<mirror::Class> klass, uint32_t descriptor_hash)
: data_(Encode(klass, MaskHash(descriptor_hash))) {
- if (kIsDebugBuild) {
- std::string temp;
- const uint32_t hash = ComputeModifiedUtf8Hash(klass->GetDescriptor(&temp));
- CHECK_EQ(descriptor_hash, hash);
- }
+ DCHECK_EQ(descriptor_hash, HashDescriptor(klass));
}
template <typename Filter>