• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1%default { "store":"sw","postbarrier":"    #  noop", "prebarrier":"    #  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 put.
9     *
10     * for: iput, iput-object, iput-boolean, iput-byte, iput-char, iput-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    # success?
26    move      a0, v0
27    bnez      v0, .L${opcode}_finish       #  yes, finish up
28    b         common_exceptionThrown
29%break
30
31    /*
32     * Currently:
33     *  a0 holds resolved field
34     *  rOBJ holds object
35     */
36.L${opcode}_finish:
37    #BAL(common_squeak${sqnum})
38    GET_OPA4(a1)                           #  a1 <- A+
39    LOAD_base_offInstField_byteOffset(a3, a0) #  a3 <- byte offset of field
40    GET_VREG(a0, a1)                       #  a0 <- fp[A]
41    # check object for null
42    beqz      rOBJ, common_errNullObject   #  object was null
43    FETCH_ADVANCE_INST(2)                  #  advance rPC, load rINST
44    GET_INST_OPCODE(t0)                    #  extract opcode from rINST
45    addu      rOBJ, rOBJ, a3               #  form address
46    $prebarrier                            #  releasing store
47    $store a0, (rOBJ)                      #  obj.field (8/16/32 bits) <- a0
48    $postbarrier
49    GOTO_OPCODE(t0)                        #  jump to next instruction
50
51