OP_AGET.S revision f3e177289ac078f18401cfd8eebafe584dd0d01f
1%default { "load":"movl", "shift":"4" }
2%verify "executed"
3    /*
4     * Array get, 32 bits or less.  vAA <- vBB[vCC].
5     *
6     * for: aget, aget-object, aget-boolean, aget-byte, aget-char, aget-short
7     */
8    /* op vAA, vBB, vCC */
9    movzbl    2(rPC),%eax               # eax<- BB
10    movzbl    3(rPC),%ecx               # ecx<- CC
11    GET_VREG_R  %eax %eax               # eax<- vBB (array object)
12    GET_VREG_R  %ecx %ecx               # ecs<- vCC (requested index)
13    testl     %eax,%eax                 # null array object?
14    je        common_errNullObject      # bail if so
15    cmpl      offArrayObject_length(%eax),%ecx
16    jae       common_errArrayIndex      # index >= length, bail
17    $load     offArrayObject_contents(%eax,%ecx,$shift),%eax
18.L${opcode}_finish:
19    FETCH_INST_OPCODE 2 %edx
20    SET_VREG  %eax rINST
21    ADVANCE_PC 2
22    GOTO_NEXT_R %edx
23