Home | History | Annotate | Download | only in x86
      1 %verify "executed"
      2 %verify "null object"
      3 %verify "field already resolved"
      4 %verify "field not yet resolved"
      5 %verify "field cannot be resolved"
      6     /*
      7      * 64-bit instance field get.
      8      *
      9      */
     10     /* op vA, vB, field@CCCC */
     11     GET_GLUE(%ecx)
     12     SPILL(rIBASE)                                 # need another reg
     13     movzwl  2(rPC),rIBASE                         # rIBASE<- 0000CCCC
     14     movl    offGlue_methodClassDex(%ecx),%eax     # eax<- DvmDex
     15     movzbl  rINST_HI,%ecx                         # ecx<- BA
     16     sarl    $$4,%ecx                              # ecx<- B
     17     movl    offDvmDex_pResFields(%eax),%eax       # eax<- pDvmDex->pResFields
     18     movzbl  rINST_HI,rINST_FULL                   # rINST_FULL<- BA
     19     andb    $$0xf,rINST_LO                        # rINST_FULL<- A
     20     GET_VREG(%ecx,%ecx)                           # ecx<- fp[B], the object ptr
     21     movl    (%eax,rIBASE,4),%eax                  # resolved entry
     22     testl   %eax,%eax                             # is resolved entry null?
     23     jne     .L${opcode}_finish                    # no, already resolved
     24     movl    rIBASE,OUT_ARG1(%esp)                 # needed by dvmResolveInstField
     25     GET_GLUE(rIBASE)
     26     jmp     .L${opcode}_resolve
     27 %break
     28 
     29 
     30 .L${opcode}_resolve:
     31     EXPORT_PC()
     32     SPILL(rPC)
     33     movl    offGlue_method(rIBASE),rPC            # rPC<- current method
     34     UNSPILL(rIBASE)
     35     movl    offMethod_clazz(rPC),rPC              # rPC<- method->clazz
     36     SPILL_TMP(%ecx)                               # save object pointer across call
     37     movl    rPC,OUT_ARG0(%esp)                    # pass in method->clazz
     38     call    dvmResolveInstField                   #  ... to dvmResolveInstField
     39     UNSPILL_TMP(%ecx)
     40     UNSPILL(rPC)
     41     testl   %eax,%eax                             #  ... which returns InstrField ptr
     42     jne     .L${opcode}_finish
     43     jmp     common_exceptionThrown
     44 
     45 .L${opcode}_finish:
     46     /*
     47      * Currently:
     48      *   eax holds resolved field
     49      *   ecx holds object
     50      *   rIBASE is scratch, but needs to be unspilled
     51      *   rINST_FULL holds A
     52      */
     53     movl    offInstField_byteOffset(%eax),%eax   # eax<- byte offset of field
     54     UNSPILL(rIBASE)
     55     testl   %ecx,%ecx                            # object null?
     56     je      common_errNullObject                 # object was null
     57     leal    (%ecx,%eax,1),%eax                   # eax<- address of field
     58     movl    (%eax),%ecx                          # ecx<- lsw
     59     movl    4(%eax),%eax                         # eax<- msw
     60     SET_VREG_WORD(%ecx,rINST_FULL,0)
     61     SET_VREG_WORD(%eax,rINST_FULL,1)
     62     FETCH_INST_WORD(2)
     63     ADVANCE_PC(2)
     64     GOTO_NEXT
     65