From 8194963098247be6bca9cc4a54dbfa65c73e8ccc Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Fri, 2 May 2014 11:53:22 +0100 Subject: Replace CountOneBits and __builtin_popcount with POPCOUNT. Clean up utils.h, make some functions constexpr. Change-Id: I2399100280cbce81c3c4f5765f0680c1ddcb5883 --- runtime/mirror/class.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runtime/mirror/class.cc') diff --git a/runtime/mirror/class.cc b/runtime/mirror/class.cc index 64a849b..662303e 100644 --- a/runtime/mirror/class.cc +++ b/runtime/mirror/class.cc @@ -257,7 +257,7 @@ void Class::SetReferenceInstanceOffsets(uint32_t new_reference_offsets) { for (Class* c = this; c != NULL; c = c->GetSuperClass()) { count += c->NumReferenceInstanceFieldsDuringLinking(); } - CHECK_EQ((size_t)__builtin_popcount(new_reference_offsets), count); + CHECK_EQ((size_t)POPCOUNT(new_reference_offsets), count); } // Not called within a transaction. SetField32(OFFSET_OF_OBJECT_MEMBER(Class, reference_instance_offsets_), @@ -268,7 +268,7 @@ void Class::SetReferenceStaticOffsets(uint32_t new_reference_offsets) { if (new_reference_offsets != CLASS_WALK_SUPER) { // Sanity check that the number of bits set in the reference offset bitmap // agrees with the number of references - CHECK_EQ((size_t)__builtin_popcount(new_reference_offsets), + CHECK_EQ((size_t)POPCOUNT(new_reference_offsets), NumReferenceStaticFieldsDuringLinking()); } // Not called within a transaction. -- cgit v1.1