1%default { "reg":"rINST", "store":"movl", "shift":"4", "data_offset":"MIRROR_INT_ARRAY_DATA_OFFSET", "wide":"0" }
2/*
3 * Array put, 32 bits or less.  vBB[vCC] <- vAA.
4 *
5 * for: aput, aput-boolean, aput-byte, aput-char, aput-short, aput-wide
6 *
7 */
8    /* op vAA, vBB, vCC */
9    movzbq  2(rPC), %rax                    # rax <- BB
10    movzbq  3(rPC), %rcx                    # rcx <- CC
11    GET_VREG %eax, %rax                     # eax <- vBB (array object)
12    GET_VREG %ecx, %rcx                     # 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    .if $wide
18    GET_WIDE_VREG rINSTq, rINSTq
19    .else
20    GET_VREG rINST, rINSTq
21    .endif
22    $store    $reg, $data_offset(%rax,%rcx,$shift)
23    ADVANCE_PC_FETCH_AND_GOTO_NEXT 2
24