1 HANDLE_OPCODE(OP_NEW_ARRAY_JUMBO /*vBBBB, vCCCC, class@AAAAAAAA*/) 2 { 3 ClassObject* arrayClass; 4 ArrayObject* newArray; 5 s4 length; 6 7 EXPORT_PC(); 8 9 ref = FETCH(1) | (u4)FETCH(2) << 16; 10 vdst = FETCH(3); 11 vsrc1 = FETCH(4); /* length reg */ 12 ILOGV("|new-array/jumbo v%d,v%d,class@0x%08x (%d elements)", 13 vdst, vsrc1, ref, (s4) GET_REGISTER(vsrc1)); 14 length = (s4) GET_REGISTER(vsrc1); 15 if (length < 0) { 16 dvmThrowNegativeArraySizeException(length); 17 GOTO_exceptionThrown(); 18 } 19 arrayClass = dvmDexGetResolvedClass(methodClassDex, ref); 20 if (arrayClass == NULL) { 21 arrayClass = dvmResolveClass(curMethod->clazz, ref, false); 22 if (arrayClass == NULL) 23 GOTO_exceptionThrown(); 24 } 25 /* verifier guarantees this is an array class */ 26 assert(dvmIsArrayClass(arrayClass)); 27 assert(dvmIsClassInitialized(arrayClass)); 28 29 newArray = dvmAllocArrayByClass(arrayClass, length, ALLOC_DONT_TRACK); 30 if (newArray == NULL) 31 GOTO_exceptionThrown(); 32 SET_REGISTER(vdst, (u4) newArray); 33 } 34 FINISH(5); 35 OP_END 36