Use accessor methods for Object fields.

Ensure that Object fields are modified via accessors so that it's easy
to insert barriers (make all fields within Objects private). Add validity
checks to Field and Method accessors to ensure they are accessed when a
Class is in a suitable state. Add validity checks to all Object
accessors to check heap isn't corrupted. Remove hacked in strings from Field
and Method; make type fields used the dex cache that is lazily initialized.
Clean up various other TODOs and lint issues.

Change-Id: Iac0afc515c01f5419874d9cdcdb9a7b45443e3fb
diff --git a/src/dex_cache.h b/src/dex_cache.h
index f2cfcc7..137f267 100644
--- a/src/dex_cache.h
+++ b/src/dex_cache.h
@@ -109,11 +109,11 @@
     return GetInitializedStaticStorage()->GetLength();
   }
 
-  const String* GetResolvedString(uint32_t string_idx) const {
+  String* GetResolvedString(uint32_t string_idx) const {
     return GetStrings()->Get(string_idx);
   }
 
-  void SetResolvedString(uint32_t string_idx, const String* resolved) {
+  void SetResolvedString(uint32_t string_idx, String* resolved) {
     GetStrings()->Set(string_idx, resolved);
   }
 
@@ -141,8 +141,8 @@
     GetResolvedFields()->Set(field_idx, resolved);
   }
 
-  ObjectArray<const String>* GetStrings() const {
-    return static_cast<ObjectArray<const String>*>(GetNonNull(kStrings));
+  ObjectArray<String>* GetStrings() const {
+    return static_cast<ObjectArray<String>*>(GetNonNull(kStrings));
   }
   ObjectArray<Class>* GetResolvedTypes() const {
     return static_cast<ObjectArray<Class>*>(GetNonNull(kResolvedTypes));