Verify encoded stack maps in debug builds.

Read all stack map data back after we write it and DCHECK the content.

Change-Id: Ia679594ac9e5805f6d4c56686030af153b45ea8b
diff --git a/runtime/base/bit_vector.h b/runtime/base/bit_vector.h
index 9b55e70..424ebb7 100644
--- a/runtime/base/bit_vector.h
+++ b/runtime/base/bit_vector.h
@@ -229,6 +229,11 @@
    */
   int GetHighestBitSet() const;
 
+  // Minimum number of bits required to store this vector, 0 if none are set.
+  size_t GetNumberOfBits() const {
+    return GetHighestBitSet() + 1;
+  }
+
   // Is bit set in storage. (No range check.)
   static bool IsBitSet(const uint32_t* storage, uint32_t idx) {
     return (storage[WordIndex(idx)] & BitMask(idx)) != 0;