Douglas Leung | 200f040 | 2016-02-25 20:05:47 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Return the length of an array. |
| 3 | */ |
Alexey Frunze | 84603bf | 2016-10-21 19:54:43 -0700 | [diff] [blame] | 4 | /* array-length vA, vB */ |
Douglas Leung | 200f040 | 2016-02-25 20:05:47 -0800 | [diff] [blame] | 5 | GET_OPB(a1) # a1 <- B |
| 6 | GET_OPA4(a2) # a2 <- A+ |
| 7 | GET_VREG(a0, a1) # a0 <- vB (object ref) |
| 8 | # is object null? |
| 9 | beqz a0, common_errNullObject # yup, fail |
| 10 | FETCH_ADVANCE_INST(1) # advance rPC, load rINST |
| 11 | LOAD_base_offMirrorArray_length(a3, a0) # a3 <- array length |
| 12 | GET_INST_OPCODE(t0) # extract opcode from rINST |
| 13 | SET_VREG_GOTO(a3, a2, t0) # vA <- length |