Simplify instance reference offsets.

Don't encode Object's class. Use trailing rather than leading zeroes to give
offset position.

Change-Id: I1ae74e7a01f63696429644adf81cdf6ee58832fe
diff --git a/runtime/mirror/class.cc b/runtime/mirror/class.cc
index 3fcb188..6df7204 100644
--- a/runtime/mirror/class.cc
+++ b/runtime/mirror/class.cc
@@ -278,14 +278,15 @@
 }
 
 void Class::SetReferenceInstanceOffsets(uint32_t new_reference_offsets) {
-  if (new_reference_offsets != CLASS_WALK_SUPER) {
+  if (kIsDebugBuild && (new_reference_offsets != kClassWalkSuper)) {
     // Sanity check that the number of bits set in the reference offset bitmap
     // agrees with the number of references
-    size_t count = 0;
+    uint32_t count = 0;
     for (Class* c = this; c != nullptr; c = c->GetSuperClass()) {
       count += c->NumReferenceInstanceFieldsDuringLinking();
     }
-    CHECK_EQ((size_t)POPCOUNT(new_reference_offsets), count);
+    // +1 for the Class in Object.
+    CHECK_EQ(static_cast<uint32_t>(POPCOUNT(new_reference_offsets)) + 1, count);
   }
   // Not called within a transaction.
   SetField32<false>(OFFSET_OF_OBJECT_MEMBER(Class, reference_instance_offsets_),