1 %default { "routine":"NoRange" } 2 %verify "executed" 3 %verify "unknown method" 4 /* 5 * Handle a static method call. 6 * 7 * for: invoke-static, invoke-static/range 8 */ 9 /* op vB, {vD, vE, vF, vG, vA}, class@CCCC */ 10 /* op {vCCCC..v(CCCC+AA-1)}, meth@BBBB */ 11 ldr r3, [rSELF, #offThread_methodClassDex] @ r3<- pDvmDex 12 FETCH(r1, 1) @ r1<- BBBB 13 ldr r3, [r3, #offDvmDex_pResMethods] @ r3<- pDvmDex->pResMethods 14 mov r9, #0 @ null "this" in delay slot 15 ldr r0, [r3, r1, lsl #2] @ r0<- resolved methodToCall 16 #if defined(WITH_JIT) 17 add r10, r3, r1, lsl #2 @ r10<- &resolved_methodToCall 18 #endif 19 cmp r0, #0 @ already resolved? 20 EXPORT_PC() @ must export for invoke 21 bne common_invokeMethod${routine} @ yes, continue on 22 b .L${opcode}_resolve 23 %break 24 25 26 .L${opcode}_resolve: 27 ldr r3, [rSELF, #offThread_method] @ r3<- self->method 28 ldr r0, [r3, #offMethod_clazz] @ r0<- method->clazz 29 mov r2, #METHOD_STATIC @ resolver method type 30 bl dvmResolveMethod @ r0<- call(clazz, ref, flags) 31 cmp r0, #0 @ got null? 32 #if defined(WITH_JIT) 33 /* 34 * Check to see if we're actively building a trace. If so, 35 * we need to keep this instruction out of it. 36 * r10: &resolved_methodToCall 37 */ 38 ldrh r2, [rSELF, #offThread_subMode] 39 beq common_exceptionThrown @ null, handle exception 40 ands r2, #kSubModeJitTraceBuild @ trace under construction? 41 beq common_invokeMethod${routine} @ no (r0=method, r9="this") 42 ldr r1, [r10] @ reload resolved method 43 cmp r1, #0 @ finished resolving? 44 bne common_invokeMethod${routine} @ yes (r0=method, r9="this") 45 mov r10, r0 @ preserve method 46 mov r0, rSELF 47 mov r1, rPC 48 bl dvmJitEndTraceSelect @ (self, pc) 49 mov r0, r10 50 b common_invokeMethod${routine} @ whew, finally! 51 #else 52 bne common_invokeMethod${routine} @ (r0=method, r9="this") 53 b common_exceptionThrown @ yes, handle exception 54 #endif 55