1 %verify "executed" 2 %verify "field already resolved" 3 %verify "field not yet resolved" 4 %verify "field cannot be resolved" 5 /* 6 * SPUT object handler. 7 */ 8 /* op vAA, field@BBBB */ 9 movl rSELF,%ecx 10 movzwl 2(rPC),%eax # eax<- field ref BBBB 11 movl offThread_methodClassDex(%ecx),%ecx # ecx<- DvmDex 12 movl offDvmDex_pResFields(%ecx),%ecx # ecx<- dvmDex->pResFields 13 movl (%ecx,%eax,4),%eax # eax<- resolved StaticField 14 testl %eax,%eax # resolved entry null? 15 je .L${opcode}_resolve # if not, make it so 16 .L${opcode}_finish: # field ptr in eax 17 movzbl rINSTbl,%ecx # ecx<- AA 18 GET_VREG_R %ecx %ecx 19 movl %ecx,offStaticField_value(%eax) # do the store 20 testl %ecx,%ecx # stored null object ptr? 21 je 1f # skip card mark if null 22 movl rSELF,%ecx 23 movl offField_clazz(%eax),%eax # eax<- method->clazz 24 movl offThread_cardTable(%ecx),%ecx # get card table base 25 shrl $$GC_CARD_SHIFT,%eax # head to card number 26 movb %cl,(%ecx,%eax) # mark card 27 1: 28 FETCH_INST_OPCODE 2 %ecx 29 ADVANCE_PC 2 30 GOTO_NEXT_R %ecx 31 32 .L${opcode}_resolve: 33 movl rSELF,%ecx 34 movzwl 2(rPC),%eax # eax<- field ref BBBB 35 movl offThread_method(%ecx),%ecx # ecx<- current method 36 EXPORT_PC # could throw, need to export 37 movl offMethod_clazz(%ecx),%ecx # ecx<- method->clazz 38 movl %eax,OUT_ARG1(%esp) 39 movl %ecx,OUT_ARG0(%esp) 40 SPILL(rIBASE) 41 call dvmResolveStaticField # eax<- resolved StaticField ptr 42 UNSPILL(rIBASE) 43 testl %eax,%eax 44 jne .L${opcode}_finish # success, continue 45 jmp common_exceptionThrown # no, handle exception 46