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/utf.cc b/src/utf.cc
index 9356197..31fbe97 100644
--- a/src/utf.cc
+++ b/src/utf.cc
@@ -3,6 +3,7 @@
 #include "utf.h"
 
 #include "logging.h"
+#include "object.h"
 
 namespace art {
 
@@ -51,6 +52,15 @@
   }
 }
 
+int32_t ComputeUtf16Hash(const CharArray* chars, int32_t offset,
+                         size_t char_count) {
+  int32_t hash = 0;
+  for (size_t i = 0; i < char_count; i++) {
+    hash = hash * 31 + chars->Get(offset + i);
+  }
+  return hash;
+}
+
 int32_t ComputeUtf16Hash(const uint16_t* chars, size_t char_count) {
   int32_t hash = 0;
   while (char_count--) {
@@ -59,6 +69,7 @@
   return hash;
 }
 
+
 uint16_t GetUtf16FromUtf8(const char** utf8_data_in) {
   uint8_t one = *(*utf8_data_in)++;
   if ((one & 0x80) == 0) {