1 %default { "postbarrier":"# no-op", "prebarrier":"# no-op" } 2 %verify "executed" 3 %verify "field already resolved" 4 %verify "field not yet resolved" 5 %verify "field cannot be resolved" 6 /* 7 * General 32-bit SPUT handler. 8 * 9 * for: sput-object, sput-object-volatile 10 */ 11 /* op vAA, field@BBBB */ 12 LOAD_rSELF_methodClassDex(a2) # a2 <- DvmDex 13 FETCH(a1, 1) # a1 <- field ref BBBB 14 LOAD_base_offDvmDex_pResFields(rBIX, a2) # rBIX <- dvmDex->pResFields 15 LOAD_eas2(a0, rBIX, a1) # a0 <- resolved StaticField ptr 16 bnez a0, .L${opcode}_finish # is resolved entry null? 17 18 /* Continuation if the field has not yet been resolved. 19 * a1: BBBB field ref 20 * rBIX: dvmDex->pResFields 21 */ 22 LOAD_rSELF_method(a2) # a2 <- current method 23 #if defined(WITH_JIT) 24 EAS2(rBIX, rBIX, a1) # rBIX<- &dvmDex->pResFields[field] 25 #endif 26 EXPORT_PC() # resolve() may throw, so export now 27 LOAD_base_offMethod_clazz(a0, a2) # a0 <- method->clazz 28 JAL(dvmResolveStaticField) # v0 <- resolved StaticField ptr 29 move a0, v0 30 beqz v0, common_exceptionThrown # success? no, handle exception 31 #if defined(WITH_JIT) 32 /* 33 * If the JIT is actively building a trace we need to make sure 34 * that the field is fully resolved before including this instruction. 35 */ 36 JAL(common_verifyField) 37 #endif 38 b .L${opcode}_finish # resume 39 40 %break 41 .L${opcode}_finish: # field ptr in a0 42 GET_OPA(a2) # a2 <- AA 43 FETCH_ADVANCE_INST(2) # advance rPC, load rINST 44 GET_VREG(a1, a2) # a1 <- fp[AA] 45 lw a2, offThread_cardTable(rSELF) # a2 <- card table base 46 lw t1, offField_clazz(a0) # t1 <- field->clazz 47 GET_INST_OPCODE(t0) # extract opcode from rINST 48 $prebarrier # releasing store 49 sw a1, offStaticField_value(a0) # field <- vAA 50 $postbarrier 51 beqz a1, 1f 52 srl t2, t1, GC_CARD_SHIFT 53 addu t3, a2, t2 54 sb a2, (t3) 55 1: 56 GOTO_OPCODE(t0) # jump to next instruction 57