Home | History | Annotate | Download | only in x86
      1 %default { "load":"movl", "sqnum":"0" }
      2 %verify "executed"
      3 %verify "null object"
      4 %verify "field already resolved"
      5 %verify "field not yet resolved"
      6 %verify "field cannot be resolved"
      7     /*
      8      * General 32-bit instance field get.
      9      *
     10      * for: iget, iget-object, iget-boolean, iget-byte, iget-char, iget-short
     11      */
     12     /* op vA, vB, field@CCCC */
     13     movl    rSELF,%ecx
     14     SPILL(rIBASE)                               # preserve rIBASE
     15     movzwl  2(rPC),rIBASE                       # rIBASE<- 0000CCCC
     16     movl    offThread_methodClassDex(%ecx),%eax # eax<- DvmDex
     17     movzbl  rINSTbl,%ecx                        # ecx<- BA
     18     sarl    $$4,%ecx                            # ecx<- B
     19     movl    offDvmDex_pResFields(%eax),%eax     # eax<- pDvmDex->pResFields
     20     andb    $$0xf,rINSTbl                       # rINST<- A
     21     GET_VREG_R %ecx %ecx                        # ecx<- fp[B], the object ptr
     22     movl    (%eax,rIBASE,4),%eax                # resolved entry
     23     testl   %eax,%eax                           # is resolved entry null?
     24     jne     .L${opcode}_finish                  # no, already resolved
     25     movl    rIBASE,OUT_ARG1(%esp)               # needed by dvmResolveInstField
     26     movl    rSELF,rIBASE
     27     EXPORT_PC
     28     movl    offThread_method(rIBASE),rIBASE     # rIBASE<- current method
     29     movl    offMethod_clazz(rIBASE),rIBASE      # rIBASE<- method->clazz
     30     SPILL_TMP1(%ecx)                            # save obj pointer across call
     31     movl    rIBASE,OUT_ARG0(%esp)               # pass in method->clazz
     32     call    dvmResolveInstField                 #  ... to dvmResolveInstField
     33     UNSPILL_TMP1(%ecx)
     34     testl   %eax,%eax                           #  returns InstrField ptr
     35     jne     .L${opcode}_finish
     36     jmp     common_exceptionThrown
     37 
     38 .L${opcode}_finish:
     39     /*
     40      * Currently:
     41      *   eax holds resolved field
     42      *   ecx holds object
     43      *   rINST holds A
     44      */
     45     movl    offInstField_byteOffset(%eax),%eax  # eax<- byte offset of field
     46     testl   %ecx,%ecx                           # object null?
     47     je      common_errNullObject                # object was null
     48     $load   (%ecx,%eax,1),%ecx                  # ecx<- obj.field (8/16/32 bits)
     49     FETCH_INST_OPCODE 2 %eax
     50     UNSPILL(rIBASE)
     51     SET_VREG %ecx rINST
     52     ADVANCE_PC 2
     53     GOTO_NEXT_R %eax
     54