1 %default { "isrange":"0", "routine":"NoRange" } 2 %verify "executed" 3 %verify "unknown method" 4 /* 5 * Handle a "super" method call. 6 * 7 * for: invoke-super, invoke-super/range 8 */ 9 /* op vB, {vD, vE, vF, vG, vA}, class@CCCC */ 10 /* op vAA, {vCCCC..v(CCCC+AA-1)}, meth@BBBB */ 11 FETCH(r10, 2) @ r10<- GFED or CCCC 12 ldr r3, [rSELF, #offThread_methodClassDex] @ r3<- pDvmDex 13 .if (!$isrange) 14 and r10, r10, #15 @ r10<- D (or stays CCCC) 15 .endif 16 FETCH(r1, 1) @ r1<- BBBB 17 ldr r3, [r3, #offDvmDex_pResMethods] @ r3<- pDvmDex->pResMethods 18 GET_VREG(r9, r10) @ r9<- "this" ptr 19 ldr r0, [r3, r1, lsl #2] @ r0<- resolved baseMethod 20 cmp r9, #0 @ null "this"? 21 ldr r10, [rSELF, #offThread_method] @ r10<- current method 22 beq common_errNullObject @ null "this", throw exception 23 cmp r0, #0 @ already resolved? 24 ldr r10, [r10, #offMethod_clazz] @ r10<- method->clazz 25 EXPORT_PC() @ must export for invoke 26 bne .L${opcode}_continue @ resolved, continue on 27 b .L${opcode}_resolve @ do resolve now 28 %break 29 30 /* 31 * At this point: 32 * r0 = resolved base method 33 * r10 = method->clazz 34 */ 35 .L${opcode}_continue: 36 ldr r1, [r10, #offClassObject_super] @ r1<- method->clazz->super 37 ldrh r2, [r0, #offMethod_methodIndex] @ r2<- baseMethod->methodIndex 38 ldr r3, [r1, #offClassObject_vtableCount] @ r3<- super->vtableCount 39 EXPORT_PC() @ must export for invoke 40 cmp r2, r3 @ compare (methodIndex, vtableCount) 41 bcs .L${opcode}_nsm @ method not present in superclass 42 ldr r1, [r1, #offClassObject_vtable] @ r1<- ...clazz->super->vtable 43 ldr r0, [r1, r2, lsl #2] @ r3<- vtable[methodIndex] 44 bl common_invokeMethod${routine} @ continue on 45 46 .L${opcode}_resolve: 47 mov r0, r10 @ r0<- method->clazz 48 mov r2, #METHOD_VIRTUAL @ resolver method type 49 bl dvmResolveMethod @ r0<- call(clazz, ref, flags) 50 cmp r0, #0 @ got null? 51 bne .L${opcode}_continue @ no, continue 52 b common_exceptionThrown @ yes, handle exception 53 54 /* 55 * Throw a NoSuchMethodError with the method name as the message. 56 * r0 = resolved base method 57 */ 58 .L${opcode}_nsm: 59 ldr r1, [r0, #offMethod_name] @ r1<- method name 60 b common_errNoSuchMethod 61