1%default { "reg":"rINST", "store":"movl", "shift":"4", "data_offset":"MIRROR_INT_ARRAY_DATA_OFFSET" }
2/*
3 * Array put, 32 bits or less.  vBB[vCC] <- vAA.
4 *
5 * for: aput, aput-boolean, aput-byte, aput-char, aput-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    leal    $data_offset(%eax,%ecx,$shift), %eax
18    GET_VREG rINST, rINST
19    $store  $reg, (%eax)
20    ADVANCE_PC_FETCH_AND_GOTO_NEXT 2
21