1 %default {"volatile":"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 # iput-wide vA, vB, field /* CCCC */ 8 GET_OPB(a0) # a0 <- B 9 LOAD_rSELF_methodClassDex(a3) # a3 <- DvmDex 10 FETCH(a1, 1) # a1 <- field ref CCCC 11 LOAD_base_offDvmDex_pResFields(a2, a3) # a2 <- pResFields 12 GET_VREG(rOBJ, a0) # rOBJ <- fp[B], the object pointer 13 LOAD_eas2(a0, a2, a1) # a0 <- resolved InstField ptr 14 # is resolved entry null? 15 bnez a0, .L${opcode}_finish # no, already resolved 16 LOAD_rSELF_method(a2) # a2 <- current method 17 EXPORT_PC() # resolve() could throw 18 LOAD_base_offMethod_clazz(a0, a2) # a0 <- method->clazz 19 JAL(dvmResolveInstField) # v0 <- resolved InstField ptr 20 # success? 21 move a0, v0 22 bnez v0, .L${opcode}_finish # yes, finish up 23 b common_exceptionThrown 24 %break 25 26 /* 27 * Currently: 28 * a0 holds resolved field 29 * rOBJ holds object 30 */ 31 .L${opcode}_finish: 32 GET_OPA4(a2) # a2 <- A+ 33 LOAD_base_offInstField_byteOffset(a3, a0) # a3 <- byte offset of field 34 EAS2(a2, rFP, a2) # a2 <- &fp[A] 35 # check object for null 36 beqz rOBJ, common_errNullObject # object was null 37 FETCH_ADVANCE_INST(2) # advance rPC, load rINST 38 LOAD64(a0, a1, a2) # a0/a1 <- fp[A] 39 GET_INST_OPCODE(rBIX) # extract opcode from rINST 40 addu a2, rOBJ, a3 # form address 41 .if $volatile 42 JAL(dvmQuasiAtomicSwap64Sync) # stores r0/r1 into addr r2 43 # STORE64(a0, a1, a2) # obj.field (64 bits, aligned) <- a0 a1 44 .else 45 STORE64(a0, a1, a2) # obj.field (64 bits, aligned) <- a0 a1 46 .endif 47 GOTO_OPCODE(rBIX) # jump to next instruction 48 49