Home | History | Annotate | Download | only in x86
      1 %verify "executed"
      2 %verify "exception handled"
      3     /*
      4      * Execute a "native inline" instruction.
      5      *
      6      * We will be calling through a function table:
      7      *
      8      * (*gDvmInlineOpsTable[opIndex].func)(arg0, arg1, arg2, arg3, pResult)
      9      *
     10      */
     11     /* [opt] execute-inline vAA, {vC, vD, vE, vF}, inline@BBBB */
     12     GET_GLUE(%ecx)
     13     EXPORT_PC()
     14     movzwl    2(rPC),%eax               # eax<- BBBB
     15     leal      offGlue_retval(%ecx),%ecx # ecx<- & glue->retval
     16     movl      %ecx,OUT_ARG4(%esp)
     17     sarl      $$12,rINST_FULL           # rINST_FULL<- arg count (0-4)
     18     SPILL(rPC)
     19     call      .L${opcode}_continue      # make call; will return after
     20     UNSPILL(rPC)
     21     testl     %eax,%eax                 # successful?
     22     FETCH_INST_WORD(3)
     23     je        common_exceptionThrown    # no, handle exception
     24     ADVANCE_PC(3)
     25     GOTO_NEXT
     26 %break
     27 
     28 .L${opcode}_continue:
     29     /*
     30      * Extract args, call function.
     31      *  ecx = #of args (0-4)
     32      *  eax = call index
     33      *  @esp = return addr
     34      *  esp is -4 from normal
     35      *
     36      *  Go ahead and load all 4 args, even if not used.
     37      */
     38     movzwl    4(rPC),rPC
     39 
     40     movl      $$0xf,%ecx
     41     andl      rPC,%ecx
     42     GET_VREG(%ecx,%ecx)
     43     sarl      $$4,rPC
     44     movl      %ecx,4+OUT_ARG0(%esp)
     45 
     46     movl      $$0xf,%ecx
     47     andl      rPC,%ecx
     48     GET_VREG(%ecx,%ecx)
     49     sarl      $$4,rPC
     50     movl      %ecx,4+OUT_ARG1(%esp)
     51 
     52     movl      $$0xf,%ecx
     53     andl      rPC,%ecx
     54     GET_VREG(%ecx,%ecx)
     55     sarl      $$4,rPC
     56     movl      %ecx,4+OUT_ARG2(%esp)
     57 
     58     movl      $$0xf,%ecx
     59     andl      rPC,%ecx
     60     GET_VREG(%ecx,%ecx)
     61     sarl      $$4,rPC
     62     movl      %ecx,4+OUT_ARG3(%esp)
     63 
     64     sall      $$4,%eax      # index *= sizeof(table entry)
     65     jmp       *gDvmInlineOpsTable(%eax)
     66     # will return to caller of .L${opcode}_continue
     67