• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1%default {"volatile":"0"}
2%verify "executed"
3%verify "field already resolved"
4%verify "field not yet resolved"
5%verify "field cannot be resolved"
6    /*
7     * 64-bit SPUT handler.
8     */
9    /* sput-wide vAA, field@BBBB */
10    ldr     r0, [rSELF, #offThread_methodClassDex]  @ r0<- DvmDex
11    FETCH(r1, 1)                        @ r1<- field ref BBBB
12    ldr     r10, [r0, #offDvmDex_pResFields] @ r10<- dvmDex->pResFields
13    mov     r9, rINST, lsr #8           @ r9<- AA
14    ldr     r2, [r10, r1, lsl #2]        @ r2<- resolved StaticField ptr
15    add     r9, rFP, r9, lsl #2         @ r9<- &fp[AA]
16    cmp     r2, #0                      @ is resolved entry null?
17    beq     .L${opcode}_resolve         @ yes, do resolve
18.L${opcode}_finish: @ field ptr in r2, AA in r9
19    FETCH_ADVANCE_INST(2)               @ advance rPC, load rINST
20    ldmia   r9, {r0-r1}                 @ r0/r1<- vAA/vAA+1
21    GET_INST_OPCODE(r10)                @ extract opcode from rINST
22    .if $volatile
23    add     r2, r2, #offStaticField_value @ r2<- pointer to data
24    bl      dvmQuasiAtomicSwap64Sync    @ stores r0/r1 into addr r2
25    .else
26    strd    r0, [r2, #offStaticField_value] @ field<- vAA/vAA+1
27    .endif
28    GOTO_OPCODE(r10)                    @ jump to next instruction
29%break
30
31    /*
32     * Continuation if the field has not yet been resolved.
33     *  r1:  BBBB field ref
34     *  r9:  &fp[AA]
35     *  r10: dvmDex->pResFields
36     *
37     * Returns StaticField pointer in r2.
38     */
39.L${opcode}_resolve:
40    ldr     r2, [rSELF, #offThread_method]    @ r2<- current method
41#if defined(WITH_JIT)
42    add     r10, r10, r1, lsl #2        @ r10<- &dvmDex->pResFields[field]
43#endif
44    EXPORT_PC()                         @ resolve() could throw, so export now
45    ldr     r0, [r2, #offMethod_clazz]  @ r0<- method->clazz
46    bl      dvmResolveStaticField       @ r0<- resolved StaticField ptr
47    cmp     r0, #0                      @ success?
48    mov     r2, r0                      @ copy to r2
49    beq     common_exceptionThrown      @ no, handle exception
50#if defined(WITH_JIT)
51    /*
52     * If the JIT is actively building a trace we need to make sure
53     * that the field is fully resolved before including this instruction.
54     */
55    bl      common_verifyField
56#endif
57    b       .L${opcode}_finish          @ resume
58