• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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     * Ignores argument count - always loads 4.
11     *
12     */
13    /* [opt] execute-inline vAA, {vC, vD, vE, vF}, inline@BBBB */
14    movl      rSELF,%ecx
15    EXPORT_PC
16    movzwl    2(rPC),%eax               # eax<- BBBB
17    leal      offThread_retval(%ecx),%ecx # ecx<- & self->retval
18    SPILL(rIBASE)                       # preserve rIBASE
19    movl      %ecx,OUT_ARG4(%esp)
20    call      .L${opcode}_continue      # make call; will return after
21    UNSPILL(rIBASE)                     # restore rIBASE
22    testl     %eax,%eax                 # successful?
23    FETCH_INST_OPCODE 3 %ecx
24    je        common_exceptionThrown    # no, handle exception
25    ADVANCE_PC 3
26    GOTO_NEXT_R %ecx
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),rIBASE
39
40    movl      $$0xf,%ecx
41    andl      rIBASE,%ecx
42    GET_VREG_R  %ecx %ecx
43    sarl      $$4,rIBASE
44    movl      %ecx,4+OUT_ARG0(%esp)
45
46    movl      $$0xf,%ecx
47    andl      rIBASE,%ecx
48    GET_VREG_R  %ecx %ecx
49    sarl      $$4,rIBASE
50    movl      %ecx,4+OUT_ARG1(%esp)
51
52    movl      $$0xf,%ecx
53    andl      rIBASE,%ecx
54    GET_VREG_R  %ecx %ecx
55    sarl      $$4,rIBASE
56    movl      %ecx,4+OUT_ARG2(%esp)
57
58    movl      $$0xf,%ecx
59    andl      rIBASE,%ecx
60    GET_VREG_R  %ecx %ecx
61    sarl      $$4,rIBASE
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