ART: A couple of checks were missed in class LockWord

Change-Id: I1fc2d77f78f49741c1316ccc76b02357158dfdbe
diff --git a/runtime/lock_word-inl.h b/runtime/lock_word-inl.h
index 414b3bb..cf6f83c 100644
--- a/runtime/lock_word-inl.h
+++ b/runtime/lock_word-inl.h
@@ -50,6 +50,7 @@
 inline LockWord::LockWord(Monitor* mon)
     : value_(mon->GetMonitorId() | (kStateFat << kStateShift)) {
   DCHECK_EQ(FatLockMonitor(), mon);
+  DCHECK_LE(mon->GetMonitorId(), static_cast<uint32_t>(kMaxMonitorId));
 }
 
 inline int32_t LockWord::GetHashCode() const {
diff --git a/runtime/lock_word.h b/runtime/lock_word.h
index e585412..13cc3b0 100644
--- a/runtime/lock_word.h
+++ b/runtime/lock_word.h
@@ -63,6 +63,7 @@
 
     kThinLockOwnerShift = 0,
     kThinLockOwnerMask = (1 << kThinLockOwnerSize) - 1,
+    kThinLockMaxOwner = kThinLockOwnerMask,
     // Count in higher bits.
     kThinLockCountShift = kThinLockOwnerSize + kThinLockOwnerShift,
     kThinLockCountMask = (1 << kThinLockCountSize) - 1,
@@ -80,10 +81,13 @@
     kHashShift = 0,
     kHashSize = 32 - kStateSize,
     kHashMask = (1 << kHashSize) - 1,
+    kMaxHash = kHashMask,
+    kMaxMonitorId = kMaxHash
   };
 
   static LockWord FromThinLockId(uint32_t thread_id, uint32_t count) {
-    CHECK_LE(thread_id, static_cast<uint32_t>(kThinLockOwnerMask));
+    CHECK_LE(thread_id, static_cast<uint32_t>(kThinLockMaxOwner));
+    CHECK_LE(count, static_cast<uint32_t>(kThinLockMaxCount));
     return LockWord((thread_id << kThinLockOwnerShift) | (count << kThinLockCountShift) |
                      (kStateThinOrUnlocked << kStateShift));
   }
@@ -94,7 +98,7 @@
   }
 
   static LockWord FromHashCode(uint32_t hash_code) {
-    CHECK_LE(hash_code, static_cast<uint32_t>(kHashMask));
+    CHECK_LE(hash_code, static_cast<uint32_t>(kMaxHash));
     return LockWord((hash_code << kHashShift) | (kStateHash << kStateShift));
   }