summaryrefslogtreecommitdiff
path: root/vm/mterp/x86/OP_ARRAY_LENGTH.S
blob: 25caca3d6be60613dfa097110f58e14438d11f91 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
%verify "executed"
    /*
     * Return the length of an array.
     */
   mov      rINST,%eax                # eax<- BA
   sarl     $$4,rINST                 # rINST<- B
   GET_VREG_R %ecx rINST              # ecx<- vB (object ref)
   andb     $$0xf,%al                 # eax<- A
   testl    %ecx,%ecx                 # is null?
   je       common_errNullObject
   movl     offArrayObject_length(%ecx),rINST
   FETCH_INST_OPCODE 1 %ecx
   ADVANCE_PC 1
   SET_VREG rINST %eax
   GOTO_NEXT_R %ecx