• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1%verify "executed"
2    /*
3     * Array put, 32 bits or less.  vBB[vCC] <- vAA
4     *
5     * for: aput, aput-object, aput-boolean, aput-byte, aput-char, aput-short
6     */
7    /* op vAA, vBB, vCC */
8    movzbl    2(rPC),%eax               # eax<- BB
9    movzbl    3(rPC),%ecx               # ecx<- CC
10    movzbl    rINST_HI,rINST_FULL       # rINST_FULL<- AA
11    GET_VREG(%eax,%eax)                 # eax<- vBB (array object)
12    GET_VREG(%ecx,%ecx)                 # ecs<- vCC (requested index)
13    GET_VREG(rINST_FULL,rINST_FULL)     # rINST_FULL<- vAA
14    testl     %eax,%eax                 # null array object?
15    je        common_errNullObject      # bail if so
16    cmpl      offArrayObject_length(%eax),%ecx
17    jb        .L${opcode}_continue
18    jmp       common_errArrayIndex      # index >= length, bail
19%break
20
21    /* On entry:
22     *   eax<- array object
23     *   ecx<- index
24     *   rINST_FULL<- vAA
25     */
26.L${opcode}_continue:
27    leal      offArrayObject_contents(%eax,%ecx,4),%ecx
28    testl     rINST_FULL,rINST_FULL     # storing null reference?
29    je        .L${opcode}_skip_check
30    SPILL(rPC)
31    SPILL_TMP(%ecx)
32    movl      offObject_clazz(%eax),%eax # eax<- arrayObj->clazz
33    movl      offObject_clazz(rINST_FULL),%ecx # ecx<- obj->clazz
34    movl      %eax,OUT_ARG1(%esp)
35    movl      %ecx,OUT_ARG0(%esp)
36    call      dvmCanPutArrayElement     # test object type vs. array type
37    UNSPILL(rPC)
38    UNSPILL_TMP(%ecx)
39    testl     %eax,%eax
40    je        common_errArrayStore
41
42.L${opcode}_skip_check:
43    movl      rINST_FULL,(%ecx)
44    FETCH_INST_WORD(2)
45    ADVANCE_PC(2)
46    GOTO_NEXT
47
48