1 %default { "prebarrier":"@ no-op", "postbarrier":"@ 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, sput-boolean, sput-byte, sput-char, sput-short 10 */ 11 /* op vAA, field@BBBB */ 12 ldr r2, [rSELF, #offThread_methodClassDex] @ r2<- DvmDex 13 FETCH(r1, 1) @ r1<- field ref BBBB 14 ldr r10, [r2, #offDvmDex_pResFields] @ r10<- dvmDex->pResFields 15 ldr r0, [r10, r1, lsl #2] @ r0<- resolved StaticField ptr 16 cmp r0, #0 @ is resolved entry null? 17 beq .L${opcode}_resolve @ yes, do resolve 18 .L${opcode}_finish: @ field ptr in r0 19 mov r2, rINST, lsr #8 @ r2<- AA 20 FETCH_ADVANCE_INST(2) @ advance rPC, load rINST 21 GET_VREG(r1, r2) @ r1<- fp[AA] 22 GET_INST_OPCODE(ip) @ extract opcode from rINST 23 $prebarrier @ releasing store 24 str r1, [r0, #offStaticField_value] @ field<- vAA 25 $postbarrier 26 GOTO_OPCODE(ip) @ jump to next instruction 27 %break 28 29 /* 30 * Continuation if the field has not yet been resolved. 31 * r1: BBBB field ref 32 * r10: dvmDex->pResFields 33 */ 34 .L${opcode}_resolve: 35 ldr r2, [rSELF, #offThread_method] @ r2<- current method 36 #if defined(WITH_JIT) 37 add r10, r10, r1, lsl #2 @ r10<- &dvmDex->pResFields[field] 38 #endif 39 EXPORT_PC() @ resolve() could throw, so export now 40 ldr r0, [r2, #offMethod_clazz] @ r0<- method->clazz 41 bl dvmResolveStaticField @ r0<- resolved StaticField ptr 42 cmp r0, #0 @ success? 43 beq common_exceptionThrown @ no, handle exception 44 #if defined(WITH_JIT) 45 /* 46 * If the JIT is actively building a trace we need to make sure 47 * that the field is fully resolved before including this instruction. 48 */ 49 bl common_verifyField 50 #endif 51 b .L${opcode}_finish @ resume 52