OSDN Git Service

am d336a946: am 024b7b9d: am a0739ea3: am af242824: Revert "Fix a type error in the...
[android-x86/dalvik.git] / vm / native / dalvik_system_VMRuntime.cpp
index b704e3e..8d84991 100644 (file)
@@ -97,6 +97,7 @@ static void Dalvik_dalvik_system_VMRuntime_newNonMovableArray(const u4* args,
 {
     ClassObject* elementClass = (ClassObject*) args[1];
     int length = args[2];
+    ArrayObject* newArray;
 
     if (elementClass == NULL) {
         dvmThrowNullPointerException(NULL);
@@ -110,10 +111,7 @@ static void Dalvik_dalvik_system_VMRuntime_newNonMovableArray(const u4* args,
     // TODO: right now, we don't have a copying collector, so there's no need
     // to do anything special here, but we ought to pass the non-movability
     // through to the allocator.
-    ClassObject* arrayClass = dvmFindArrayClassForElement(elementClass);
-    ArrayObject* newArray = dvmAllocArrayByClass(arrayClass,
-                                                 length,
-                                                 ALLOC_DEFAULT);
+    newArray = dvmAllocObjectArray(elementClass, length, ALLOC_DEFAULT);
     if (newArray == NULL) {
         assert(dvmCheckException(dvmThreadSelf()));
         RETURN_VOID();