修訂 | 6bc44b183d2e62baf8bed9e1a46827d361106d3d (tree) |
---|---|
時間 | 2011-11-06 02:26:28 |
作者 | Chih-Wei Huang <cwhuang@linu...> |
Commiter | Chih-Wei Huang |
Merge branch 'aosp/honeycomb-LTE-release' into honeycomb-mr2-x86
@@ -128,7 +128,6 @@ static void Dalvik_dalvik_system_VMRuntime_newNonMovableArray(const u4* args, | ||
128 | 128 | { |
129 | 129 | ClassObject* elementClass = (ClassObject*) args[1]; |
130 | 130 | int length = args[2]; |
131 | - ArrayObject* newArray; | |
132 | 131 | |
133 | 132 | if (elementClass == NULL) { |
134 | 133 | dvmThrowException("Ljava/lang/NullPointerException;", NULL); |
@@ -142,7 +141,10 @@ static void Dalvik_dalvik_system_VMRuntime_newNonMovableArray(const u4* args, | ||
142 | 141 | // TODO: right now, we don't have a copying collector, so there's no need |
143 | 142 | // to do anything special here, but we ought to pass the non-movability |
144 | 143 | // through to the allocator. |
145 | - newArray = dvmAllocObjectArray(elementClass, length, ALLOC_DEFAULT); | |
144 | + ClassObject* arrayClass = dvmFindArrayClassForElement(elementClass); | |
145 | + ArrayObject* newArray = dvmAllocArrayByClass(arrayClass, | |
146 | + length, | |
147 | + ALLOC_DEFAULT); | |
146 | 148 | if (newArray == NULL) { |
147 | 149 | assert(dvmCheckException(dvmThreadSelf())); |
148 | 150 | RETURN_VOID(); |