{
ClassObject* elementClass = (ClassObject*) args[1];
int length = args[2];
+ ArrayObject* newArray;
if (elementClass == NULL) {
dvmThrowNullPointerException(NULL);
// 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();