Object model changes to support 64bit.

Modify mirror objects so that references between them use an ObjectReference
value type rather than an Object* so that functionality to compress larger
references can be captured in the ObjectRefererence implementation.
ObjectReferences are 32bit and all other aspects of object layout remain as
they are currently.

Expand fields in objects holding pointers so they can hold 64bit pointers. Its
expected the size of these will come down by improving where we hold compiler
meta-data.
Stub out x86_64 architecture specific runtime implementation.
Modify OutputStream so that reads and writes are of unsigned quantities.
Make the use of portable or quick code more explicit.
Templatize AtomicInteger to support more than just int32_t as a type.
Add missing, and fix issues relating to, missing annotalysis information on the
mutator lock.
Refactor and share implementations for array copy between System and uses
elsewhere in the runtime.
Fix numerous 64bit build issues.

Change-Id: I1a5694c251a42c9eff71084dfdd4b51fff716822
diff --git a/runtime/utils.cc b/runtime/utils.cc
index a293043..aad21bc 100644
--- a/runtime/utils.cc
+++ b/runtime/utils.cc
@@ -215,14 +215,14 @@
   }
 }
 
-std::string PrettyDescriptor(const mirror::String* java_descriptor) {
+std::string PrettyDescriptor(mirror::String* java_descriptor) {
   if (java_descriptor == NULL) {
     return "null";
   }
   return PrettyDescriptor(java_descriptor->ToModifiedUtf8());
 }
 
-std::string PrettyDescriptor(const mirror::Class* klass) {
+std::string PrettyDescriptor(mirror::Class* klass) {
   if (klass == NULL) {
     return "null";
   }
@@ -283,7 +283,7 @@
   return PrettyDescriptor(descriptor_string);
 }
 
-std::string PrettyField(const mirror::ArtField* f, bool with_type) {
+std::string PrettyField(mirror::ArtField* f, bool with_type) {
   if (f == NULL) {
     return "null";
   }
@@ -358,7 +358,7 @@
   return PrettyDescriptor(return_type);
 }
 
-std::string PrettyMethod(const mirror::ArtMethod* m, bool with_signature) {
+std::string PrettyMethod(mirror::ArtMethod* m, bool with_signature) {
   if (m == nullptr) {
     return "null";
   }
@@ -401,7 +401,7 @@
   return result;
 }
 
-std::string PrettyTypeOf(const mirror::Object* obj) {
+std::string PrettyTypeOf(mirror::Object* obj) {
   if (obj == NULL) {
     return "null";
   }
@@ -417,7 +417,7 @@
   return result;
 }
 
-std::string PrettyClass(const mirror::Class* c) {
+std::string PrettyClass(mirror::Class* c) {
   if (c == NULL) {
     return "null";
   }
@@ -428,7 +428,7 @@
   return result;
 }
 
-std::string PrettyClassAndClassLoader(const mirror::Class* c) {
+std::string PrettyClassAndClassLoader(mirror::Class* c) {
   if (c == NULL) {
     return "null";
   }
@@ -445,7 +445,7 @@
 std::string PrettySize(int64_t byte_count) {
   // The byte thresholds at which we display amounts.  A byte count is displayed
   // in unit U when kUnitThresholds[U] <= bytes < kUnitThresholds[U+1].
-  static const size_t kUnitThresholds[] = {
+  static const int64_t kUnitThresholds[] = {
     0,              // B up to...
     3*1024,         // KB up to...
     2*1024*1024,    // MB up to...
@@ -464,7 +464,7 @@
       break;
     }
   }
-  return StringPrintf("%s%lld%s", negative_str, byte_count / kBytesPerUnit[i], kUnitStrings[i]);
+  return StringPrintf("%s%" PRId64 "%s", negative_str, byte_count / kBytesPerUnit[i], kUnitStrings[i]);
 }
 
 std::string PrettyDuration(uint64_t nano_duration) {
@@ -534,18 +534,18 @@
   uint64_t whole_part = nano_duration / divisor;
   uint64_t fractional_part = nano_duration % divisor;
   if (fractional_part == 0) {
-    return StringPrintf("%llu%s", whole_part, unit);
+    return StringPrintf("%" PRIu64 "%s", whole_part, unit);
   } else {
     while ((fractional_part % 1000) == 0) {
       zero_fill -= 3;
       fractional_part /= 1000;
     }
     if (zero_fill == 3) {
-      return StringPrintf("%llu.%03llu%s", whole_part, fractional_part, unit);
+      return StringPrintf("%" PRIu64 ".%03" PRIu64 "%s", whole_part, fractional_part, unit);
     } else if (zero_fill == 6) {
-      return StringPrintf("%llu.%06llu%s", whole_part, fractional_part, unit);
+      return StringPrintf("%" PRIu64 ".%06" PRIu64 "%s", whole_part, fractional_part, unit);
     } else {
-      return StringPrintf("%llu.%09llu%s", whole_part, fractional_part, unit);
+      return StringPrintf("%" PRIu64 ".%09" PRIu64 "%s", whole_part, fractional_part, unit);
     }
   }
 }
@@ -627,7 +627,7 @@
   return descriptor;
 }
 
-std::string JniShortName(const mirror::ArtMethod* m) {
+std::string JniShortName(mirror::ArtMethod* m) {
   MethodHelper mh(m);
   std::string class_name(mh.GetDeclaringClassDescriptor());
   // Remove the leading 'L' and trailing ';'...
@@ -646,7 +646,7 @@
   return short_name;
 }
 
-std::string JniLongName(const mirror::ArtMethod* m) {
+std::string JniLongName(mirror::ArtMethod* m) {
   std::string long_name;
   long_name += JniShortName(m);
   long_name += "__";