Home | History | Annotate | Download | only in x86
      1 %default { "routine":"NoRange","isrange":"0" }
      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     movl      rSELF,%ecx
     12     movzwl    2(rPC),%eax               # eax<- BBBB
     13     movl      offThread_methodClassDex(%ecx),%ecx # ecx<- pDvmDex
     14     EXPORT_PC
     15     movl      offDvmDex_pResMethods(%ecx),%ecx  # ecx<- pDvmDex->pResMethods
     16 #if defined(WITH_JIT)
     17     movl     %edx, TMP_SPILL1(%ebp)
     18     lea      (%ecx,%eax,4), %edx
     19     movl     %edx, TMP_SPILL2(%ebp)
     20     movl     TMP_SPILL1(%ebp), %edx
     21 #endif
     22     movl      (%ecx,%eax,4),%eax        # eax<- resolved methodToCall
     23     movl      $$0, %ecx                 # make "this" null
     24     testl     %eax,%eax
     25     jne       common_invokeMethod${routine}
     26 
     27     movl      rSELF,%ecx
     28     movl      offThread_method(%ecx),%ecx # ecx<- self->method
     29     movzwl    2(rPC),%eax
     30     movl      offMethod_clazz(%ecx),%ecx# ecx<- method->clazz
     31     movl      %eax,OUT_ARG1(%esp)       # arg1<- BBBB
     32     movl      %ecx,OUT_ARG0(%esp)       # arg0<- clazz
     33     movl      $$METHOD_STATIC,%eax
     34     movl      %eax,OUT_ARG2(%esp)       # arg2<- flags
     35     SPILL(rIBASE)
     36     call      dvmResolveMethod          # call(clazz,ref,flags)
     37     UNSPILL(rIBASE)
     38     testl     %eax,%eax                 # got null?
     39 #if defined(WITH_JIT)
     40     movl      TMP_SPILL1(%ebp), %edx
     41     movl      rSELF,%ecx
     42     movzwl    offThread_subMode(%ecx), %ecx
     43     je        common_exceptionThrown    # null, handle exception
     44     andl      $$kSubModeJitTraceBuild, %ecx # is trace under construction?
     45     movl      $$0, %ecx                 # make "this" null
     46     je        common_invokeMethod${routine} # no (%eax=method, %ecx="this")
     47     movl      TMP_SPILL2(%ebp), %edx
     48     cmpl      $$0, (%edx)                  # finished resolving
     49     movl      TMP_SPILL1(%ebp), %edx
     50     jne        common_invokeMethod${routine} # yes (%eax=method, %ecx="this")
     51     movl      rSELF, %edx
     52     movl      %edx, OUT_ARG0(%esp)
     53     movl      rPC, OUT_ARG1(%esp)
     54     movl      %eax, TMP_SPILL2(%ebp)
     55     movl      %ecx, TMP_SPILL3(%ebp)
     56     SPILL(rIBASE)
     57     call      dvmJitEndTraceSelect
     58     UNSPILL(rIBASE)
     59     movl      TMP_SPILL1(%ebp), %edx
     60     movl      TMP_SPILL2(%ebp), %eax
     61     movl      TMP_SPILL3(%ebp), %ecx
     62     jmp       common_invokeMethod${routine}
     63 #else
     64     movl      $$0, %ecx                 # make "this" null
     65     jne       common_invokeMethod${routine}
     66     jmp       common_exceptionThrown
     67 #endif
     68 
     69