1%default { "load":"movl", "shift":"4", "data_offset":"MIRROR_INT_ARRAY_DATA_OFFSET" }
2/*
3 * Array get, 32 bits or less.  vAA <- vBB[vCC].
4 *
5 * for: aget, aget-boolean, aget-byte, aget-char, aget-short
6 *
7 */
8    /* op vAA, vBB, vCC */
9    movzbl  2(rPC), %eax                    # eax <- BB
10    movzbl  3(rPC), %ecx                    # ecx <- CC
11    GET_VREG %eax, %eax                     # eax <- vBB (array object)
12    GET_VREG %ecx, %ecx                     # ecx <- vCC (requested index)
13    testl   %eax, %eax                      # null array object?
14    je      common_errNullObject            # bail if so
15    cmpl    MIRROR_ARRAY_LENGTH_OFFSET(%eax), %ecx
16    jae     common_errArrayIndex            # index >= length, bail.
17    $load   $data_offset(%eax,%ecx,$shift), %eax
18    SET_VREG %eax, rINST
19    ADVANCE_PC_FETCH_AND_GOTO_NEXT 2
20