Remove pad word from arrays

This change removes the 4 byte pad from all arrays except longs and
doubles. It saves 76kb from the boot image, and will also reduce the
size of arrays in the heap (and thereby reduce garbage collection).

Change-Id: I3ff277d5bf14c57c0f7552215818e588ec6cc275
diff --git a/src/java_lang_System.cc b/src/java_lang_System.cc
index 78100cf..b48cee9 100644
--- a/src/java_lang_System.cc
+++ b/src/java_lang_System.cc
@@ -148,9 +148,6 @@
     return;
   }
 
-  uint8_t* dstBytes = reinterpret_cast<uint8_t*>(dstArray->GetRawData());
-  const uint8_t* srcBytes = reinterpret_cast<const uint8_t*>(srcArray->GetRawData());
-
   // Handle primitive arrays.
   if (srcComponentType->IsPrimitive() || dstComponentType->IsPrimitive()) {
     // If one of the arrays holds a primitive type the other array must hold the exact same type.
@@ -162,7 +159,11 @@
       return;
     }
 
-    switch (srcArray->GetClass()->GetComponentSize()) {
+    size_t width = srcArray->GetClass()->GetComponentSize();
+    uint8_t* dstBytes = reinterpret_cast<uint8_t*>(dstArray->GetRawData(width));
+    const uint8_t* srcBytes = reinterpret_cast<const uint8_t*>(srcArray->GetRawData(width));
+
+    switch (width) {
     case 1:
       memmove(dstBytes + dstPos, srcBytes + srcPos, length);
       break;
@@ -185,6 +186,8 @@
 
   // Neither class is primitive. Are the types trivially compatible?
   const size_t width = sizeof(Object*);
+  uint8_t* dstBytes = reinterpret_cast<uint8_t*>(dstArray->GetRawData(width));
+  const uint8_t* srcBytes = reinterpret_cast<const uint8_t*>(srcArray->GetRawData(width));
   if (dstArray == srcArray || dstComponentType->IsAssignableFrom(srcComponentType)) {
     // Yes. Bulk copy.
     COMPILE_ASSERT(sizeof(width) == sizeof(uint32_t), move32_assumes_Object_references_are_32_bit);