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/dalvik_system_VMRuntime.cc b/src/dalvik_system_VMRuntime.cc
index df12658..c8a3a4c 100644
--- a/src/dalvik_system_VMRuntime.cc
+++ b/src/dalvik_system_VMRuntime.cc
@@ -77,6 +77,9 @@
 }
 
 jlong VMRuntime_addressOf(JNIEnv* env, jobject, jobject javaArray) {
+  if (javaArray == NULL) {  // Most likely allocation failed
+    return 0;
+  }
   ScopedThreadStateChange tsc(Thread::Current(), Thread::kRunnable);
   Array* array = Decode<Array*>(env, javaArray);
   if (!array->IsArrayInstance()) {
@@ -84,7 +87,7 @@
     return 0;
   }
   // TODO: we should also check that this is a non-movable array.
-  return reinterpret_cast<uintptr_t>(array->GetRawData());
+  return reinterpret_cast<uintptr_t>(array->GetRawData(array->GetClass()->GetComponentSize()));
 }
 
 void VMRuntime_clearGrowthLimit(JNIEnv*, jobject) {