1%default { "load":"lw", "barrier":" # noop", "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 get. 9 * 10 * for: iget, iget-object, iget-boolean, iget-byte, iget-char, iget-short 11 */ 12 # op vA, vB, field /* CCCC */ 13 GET_OPB(a0) # a0 <- B 14 LOAD_rSELF_methodClassDex(a3) # a3 <- DvmDex 15 FETCH(a1, 1) # a1 <- field ref CCCC 16 LOAD_base_offDvmDex_pResFields(a2, a3) # a2 <- pDvmDex->pResFields 17 GET_VREG(rOBJ, a0) # rOBJ <- fp[B], the object pointer 18 LOAD_eas2(a0, a2, a1) # a0 <- resolved InstField ptr 19 # is resolved entry null? 20 bnez a0, .L${opcode}_finish # no, already resolved 21 LOAD_rSELF_method(a2) # a2 <- current method 22 EXPORT_PC() # resolve() could throw 23 LOAD_base_offMethod_clazz(a0, a2) # a0 <- method->clazz 24 JAL(dvmResolveInstField) # v0 <- resolved InstField ptr 25 # test results 26 move a0, v0 27 bnez v0, .L${opcode}_finish 28 b common_exceptionThrown 29%break 30 31 /* 32 * Currently: 33 * v0 holds resolved field 34 * rOBJ holds object (caller saved) 35 */ 36.L${opcode}_finish: 37 #BAL(common_squeak${sqnum}) 38 LOAD_base_offInstField_byteOffset(a3, a0) # a3 <- byte offset of field 39 # check object for null 40 beqz rOBJ, common_errNullObject # object was null 41 addu a3, a3, rOBJ # form address 42 $load a0, (a3) # a0 <- obj.field (8/16/32 bits) 43 $barrier # acquiring load 44 GET_OPA4(a2) # a2 <- A+ 45 FETCH_ADVANCE_INST(2) # advance rPC, load rINST 46 GET_INST_OPCODE(t0) # extract opcode from rINST 47 SET_VREG(a0, a2) # fp[A] <- a0 48 GOTO_OPCODE(t0) # jump to next instruction 49 50