189c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project%default { "isrange":"0", "routine":"NoRange" }
289c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project%verify "executed"
389c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project%verify "unknown method"
489c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project    /*
589c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project     * Handle a direct method call.
689c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project     *
789c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project     * (We could defer the "is 'this' pointer null" test to the common
889c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project     * method invocation code, and use a flag to indicate that static
989c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project     * calls don't count.  If we do this as part of copying the arguments
1089c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project     * out we could avoiding loading the first arg twice.)
1189c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project     *
1289c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project     * for: invoke-direct, invoke-direct/range
1389c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project     */
1489c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project    /* op vB, {vD, vE, vF, vG, vA}, class@CCCC */
1589c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project    /* op {vCCCC..v(CCCC+AA-1)}, meth@BBBB */
1689c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project    GET_GLUE(%ecx)
1789c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project    movzwl    2(rPC),%eax              # eax<- BBBB
1889c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project    movl      offGlue_methodClassDex(%ecx),%ecx # ecx<- pDvmDex
1989c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project    EXPORT_PC()
2089c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project    SPILL(rPC)
2189c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project    movl      offDvmDex_pResMethods(%ecx),%ecx  # ecx<- pDvmDex->pResMethods
2289c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project    movzwl    4(rPC),rPC               # rPC<- GFED or CCCC
2389c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project    movl      (%ecx,%eax,4),%eax       # eax<- resolved methodToCall
2489c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project    .if       (!$isrange)
2589c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project    andl      $$0xf,rPC                # rPC<- D (or stays CCCC)
2689c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project    .endif
2789c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project    testl     %eax,%eax                # already resolved?
2889c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project    GET_VREG(%ecx,rPC)                 # ecx<- "this" ptr
2989c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project    je        .L${opcode}_resolve      # not resolved, do it now
3089c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project.L${opcode}_finish:
3189c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project    UNSPILL(rPC)
3289c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project    testl     %ecx,%ecx                # null "this"?
33c4080f6bdeda19901a508cc75f96ac7e07903918Johnnie Birch    jne       common_invokeMethod${routine}  # no, continue on
3489c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project    jmp       common_errNullObject
3589c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project%break
3689c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project
3789c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project    /*
3889c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project     * On entry:
3989c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project     *   TMP_SPILL  <- "this" register
4089c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project     * Things a bit ugly on this path, but it's the less
4189c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project     * frequent one.  We'll have to do some reloading.
4289c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project     */
4389c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project.L${opcode}_resolve:
4489c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project     SPILL_TMP(%ecx)
4589c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project     GET_GLUE(%ecx)
4689c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project     UNSPILL(rPC)
4789c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project     movl     offGlue_method(%ecx),%ecx  # ecx<- glue->method
4889c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project     movzwl   2(rPC),%eax      # reference (BBBB or CCCC)
4989c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project     movl     offMethod_clazz(%ecx),%ecx # ecx<- method->clazz
5089c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project     movl     $$METHOD_DIRECT,OUT_ARG2(%esp)
5189c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project     movl     %eax,OUT_ARG1(%esp)
5289c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project     movl     %ecx,OUT_ARG0(%esp)
5389c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project     call     dvmResolveMethod # eax<- call(clazz, ref, flags)
5489c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project     UNSPILL_TMP(%ecx)
5589c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project     testl    %eax,%eax
5689c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project     jne      .L${opcode}_finish
5789c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project     UNSPILL(rPC)
5889c1feb0a69a7707b271086e749975b3f7acacf7The Android Open Source Project     jmp      common_exceptionThrown
59