1 %verify "executed" 2 %verify "unknown method" 3 %verify "null object" 4 /* 5 * Handle a virtual method call. 6 */ 7 /* invoke-virtual/jumbo {vCCCC..v(CCCC+BBBB-1)}, meth@AAAAAAAA */ 8 ldr r3, [rSELF, #offThread_methodClassDex] @ r3<- pDvmDex 9 FETCH(r0, 1) @ r1<- aaaa (lo) 10 FETCH(r1, 2) @ r1<- AAAA (hi) 11 ldr r3, [r3, #offDvmDex_pResMethods] @ r3<- pDvmDex->pResMethods 12 orr r1, r0, r1, lsl #16 @ r1<- AAAAaaaa 13 ldr r0, [r3, r1, lsl #2] @ r0<- resolved baseMethod 14 cmp r0, #0 @ already resolved? 15 EXPORT_PC() @ must export for invoke 16 bne .L${opcode}_continue @ yes, continue on 17 ldr r3, [rSELF, #offThread_method] @ r3<- self->method 18 ldr r0, [r3, #offMethod_clazz] @ r0<- method->clazz 19 mov r2, #METHOD_VIRTUAL @ resolver method type 20 bl dvmResolveMethod @ r0<- call(clazz, ref, flags) 21 cmp r0, #0 @ got null? 22 bne .L${opcode}_continue @ no, continue 23 b common_exceptionThrown @ yes, handle exception 24 %break 25 26 /* 27 * At this point: 28 * r0 = resolved base method 29 */ 30 .L${opcode}_continue: 31 FETCH(r10, 4) @ r10<- CCCC 32 GET_VREG(r9, r10) @ r9<- "this" ptr 33 ldrh r2, [r0, #offMethod_methodIndex] @ r2<- baseMethod->methodIndex 34 cmp r9, #0 @ is "this" null? 35 beq common_errNullObject @ null "this", throw exception 36 ldr r3, [r9, #offObject_clazz] @ r3<- thisPtr->clazz 37 ldr r3, [r3, #offClassObject_vtable] @ r3<- thisPtr->clazz->vtable 38 ldr r0, [r3, r2, lsl #2] @ r3<- vtable[methodIndex] 39 bl common_invokeMethodJumbo @ (r0=method, r9="this") 40