runtime: Bitstring implementation for subtype checking (4/4).

Integrate the previous CLs into ART Runtime. Subsequent CLs to add
optimizing compiler support.

Use spare 24-bits from "Class#status_" field to
implement faster subtype checking in the runtime. Does not incur any extra memory overhead,
and (when in compiled code) this is always as fast or faster than the original check.

The new subtype checking is O(1) of the form:

  src <: target :=
    (*src).status >> #imm_target_mask == #imm_target_shifted

Based on the original prototype CL by Zhengkai Wu:
https://android-review.googlesource.com/#/c/platform/art/+/440996/

Test: art/test.py -b -j32 --host
Bug: 64692057
Change-Id: Iec3c54af529055a7f6147eebe5611d9ecd46942b
diff --git a/runtime/mirror/class.cc b/runtime/mirror/class.cc
index 40157c4..4d810db 100644
--- a/runtime/mirror/class.cc
+++ b/runtime/mirror/class.cc
@@ -29,6 +29,7 @@
 #include "dex_file_annotations.h"
 #include "gc/accounting/card_table-inl.h"
 #include "handle_scope-inl.h"
+#include "subtype_check.h"
 #include "method.h"
 #include "object-inl.h"
 #include "object-refvisitor-inl.h"
@@ -41,6 +42,11 @@
 #include "well_known_classes.h"
 
 namespace art {
+
+// TODO: move to own CC file?
+constexpr size_t BitString::kBitSizeAtPosition[BitString::kCapacity];
+constexpr size_t BitString::kCapacity;
+
 namespace mirror {
 
 using android::base::StringPrintf;
@@ -166,11 +172,9 @@
     self->AssertPendingException();
   }
 
-  static_assert(sizeof(Status) == sizeof(uint32_t), "Size of status not equal to uint32");
-  if (Runtime::Current()->IsActiveTransaction()) {
-    h_this->SetField32Volatile<true>(StatusOffset(), new_status);
-  } else {
-    h_this->SetField32Volatile<false>(StatusOffset(), new_status);
+  {
+    ObjPtr<mirror::Class> h_this_ptr = h_this.Get();
+    SubtypeCheck<ObjPtr<mirror::Class>>::WriteStatus(h_this_ptr, new_status);
   }
 
   // Setting the object size alloc fast path needs to be after the status write so that if the