1 %default { "store":"str", "postbarrier":"@ no-op ", "prebarrier":"@ no-op ", "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 * General 32-bit instance field put. 9 * 10 * for: iput, iput-boolean, iput-byte, iput-char, iput-short 11 */ 12 /* op vA, vB, field@CCCC */ 13 mov r0, rINST, lsr #12 @ r0<- B 14 ldr r3, [rSELF, #offThread_methodClassDex] @ r3<- DvmDex 15 FETCH(r1, 1) @ r1<- field ref CCCC 16 ldr r2, [r3, #offDvmDex_pResFields] @ r2<- pDvmDex->pResFields 17 GET_VREG(r9, r0) @ r9<- fp[B], the object pointer 18 ldr r0, [r2, r1, lsl #2] @ r0<- resolved InstField ptr 19 cmp r0, #0 @ is resolved entry null? 20 bne .L${opcode}_finish @ no, already resolved 21 8: ldr r2, [rSELF, #offThread_method] @ r2<- current method 22 EXPORT_PC() @ resolve() could throw 23 ldr r0, [r2, #offMethod_clazz] @ r0<- method->clazz 24 bl dvmResolveInstField @ r0<- resolved InstField ptr 25 cmp r0, #0 @ success? 26 bne .L${opcode}_finish @ yes, finish up 27 b common_exceptionThrown 28 %break 29 30 /* 31 * Currently: 32 * r0 holds resolved field 33 * r9 holds object 34 */ 35 .L${opcode}_finish: 36 @bl common_squeak${sqnum} 37 mov r1, rINST, lsr #8 @ r1<- A+ 38 ldr r3, [r0, #offInstField_byteOffset] @ r3<- byte offset of field 39 and r1, r1, #15 @ r1<- A 40 cmp r9, #0 @ check object for null 41 GET_VREG(r0, r1) @ r0<- fp[A] 42 beq common_errNullObject @ object was null 43 FETCH_ADVANCE_INST(2) @ advance rPC, load rINST 44 GET_INST_OPCODE(ip) @ extract opcode from rINST 45 $prebarrier @ releasing store 46 $store r0, [r9, r3] @ obj.field (8/16/32 bits)<- r0 47 $postbarrier 48 GOTO_OPCODE(ip) @ jump to next instruction 49