Home | History | Annotate | Download | only in x86
      1 %default { "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      * Object field put.
      9      *
     10      * for: iput-object
     11      */
     12     /* op vA, vB, field@CCCC */
     13     movl    rSELF,%ecx
     14     SPILL(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)
     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      *   rIBASE is scratch, but needs to be unspilled
     44      *   rINST holds A
     45      */
     46     GET_VREG_R rINST rINST                      # rINST<- v[A]
     47     movl    offInstField_byteOffset(%eax),%eax  # eax<- byte offset of field
     48     testl   %ecx,%ecx                           # object null?
     49     je      common_errNullObject                # object was null
     50     movl    rINST,(%ecx,%eax)      # obj.field <- v[A](8/16/32 bits)
     51     movl    rSELF,%eax
     52     testl   rINST,rINST                         # stored a NULL?
     53     movl    offThread_cardTable(%eax),%eax      # get card table base
     54     je      1f                                  # skip card mark if null store
     55     shrl    $$GC_CARD_SHIFT,%ecx                # object head to card number
     56     movb    %al,(%eax,%ecx)                     # mark card using object head
     57 1:
     58     UNSPILL(rIBASE)
     59     FETCH_INST_OPCODE 2 %ecx
     60     ADVANCE_PC 2
     61     GOTO_NEXT_R %ecx
     62