1 %default { "isrange":"0", "routine":"NoRange" } 2 %verify "executed" 3 %verify "unknown method" 4 /* 5 * Handle a direct method call. 6 * 7 * (We could defer the "is 'this' pointer null" test to the common 8 * method invocation code, and use a flag to indicate that static 9 * calls don't count. If we do this as part of copying the arguments 10 * out we could avoiding loading the first arg twice.) 11 * 12 * for: invoke-direct, invoke-direct/range 13 */ 14 # op vB, {vD, vE, vF, vG, vA}, class /* CCCC */ 15 # op {vCCCC..v(CCCC+AA-1)}, meth /* BBBB */ 16 LOAD_rSELF_methodClassDex(a3) # a3 <- pDvmDex 17 FETCH(a1, 1) # a1 <- BBBB 18 LOAD_base_offDvmDex_pResMethods(a3, a3) # a3 <- pDvmDex->pResMethods 19 FETCH(rBIX, 2) # rBIX <- GFED or CCCC 20 LOAD_eas2(a0, a3, a1) # a0 <- resolved methodToCall 21 .if (!$isrange) 22 and rBIX, rBIX, 15 # rBIX <- D (or stays CCCC) 23 .endif 24 EXPORT_PC() # must export for invoke 25 GET_VREG(rOBJ, rBIX) # rOBJ <- "this" ptr 26 # already resolved? 27 bnez a0, 1f # resolved, call the function 28 29 lw a3, offThread_method(rSELF) # a3 <- self->method 30 LOAD_base_offMethod_clazz(a0, a3) # a0 <- method->clazz 31 li a2, METHOD_DIRECT # resolver method type 32 JAL(dvmResolveMethod) # v0 <- call(clazz, ref, flags) 33 move a0, v0 34 # got null? 35 beqz v0, common_exceptionThrown # yes, handle exception 36 37 1: 38 bnez rOBJ, common_invokeMethod${routine} # a0=method, rOBJ="this" 39 b common_errNullObject # yes, throw exception 40 41 42 43