From c6934e36d33ab402b7b51c78d46c319fc33e8ef3 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Wed, 10 Apr 2019 11:40:01 +0100 Subject: 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 --- runtime/class_table-inl.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'runtime/class_table-inl.h') 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() == nullptr; +} + template 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 klass, uint3 inline ClassTable::TableSlot::TableSlot(ObjPtr 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 -- cgit v1.2.3-59-g8ed1b