• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1%default { "barrier":"@ no-op " }
2%verify "executed"
3%verify "field already resolved"
4%verify "field not yet resolved"
5%verify "field cannot be resolved"
6    /*
7     * Jumbo 32-bit SGET handler.
8     *
9     * for: sget/jumbo, sget-object/jumbo, sget-boolean/jumbo, sget-byte/jumbo,
10     *      sget-char/jumbo, sget-short/jumbo
11     */
12    /* exop vBBBB, field@AAAAAAAA */
13    ldr     r2, [rSELF, #offThread_methodClassDex]    @ r2<- DvmDex
14    FETCH(r0, 1)                        @ r0<- aaaa (lo)
15    FETCH(r1, 2)                        @ r1<- AAAA (hi)
16    ldr     r10, [r2, #offDvmDex_pResFields] @ r10<- dvmDex->pResFields
17    orr     r1, r0, r1, lsl #16         @ r1<- AAAAaaaa
18    ldr     r0, [r10, r1, lsl #2]       @ r0<- resolved StaticField ptr
19    cmp     r0, #0                      @ is resolved entry null?
20    beq     .L${opcode}_resolve         @ yes, do resolve
21.L${opcode}_finish: @ field ptr in r0
22    ldr     r1, [r0, #offStaticField_value] @ r1<- field value
23    $barrier                            @ acquiring load
24    FETCH(r2, 3)                        @ r2<- BBBB
25    FETCH_ADVANCE_INST(4)               @ advance rPC, load rINST
26    SET_VREG(r1, r2)                    @ fp[BBBB]<- r1
27    GET_INST_OPCODE(ip)                 @ extract opcode from rINST
28    GOTO_OPCODE(ip)                     @ jump to next instruction
29%break
30
31    /*
32     * Continuation if the field has not yet been resolved.
33     *  r1:  AAAAAAAA field ref
34     *  r10: dvmDex->pResFields
35     */
36.L${opcode}_resolve:
37    ldr     r2, [rSELF, #offThread_method]    @ r2<- current method
38#if defined(WITH_JIT)
39    add     r10, r10, r1, lsl #2        @ r10<- &dvmDex->pResFields[field]
40#endif
41    EXPORT_PC()                         @ resolve() could throw, so export now
42    ldr     r0, [r2, #offMethod_clazz]  @ r0<- method->clazz
43    bl      dvmResolveStaticField       @ r0<- resolved StaticField ptr
44    cmp     r0, #0                      @ success?
45    beq     common_exceptionThrown      @ no, handle exception
46#if defined(WITH_JIT)
47    /*
48     * If the JIT is actively building a trace we need to make sure
49     * that the field is fully resolved before including this instruction.
50     */
51    bl      common_verifyField
52#endif
53    b       .L${opcode}_finish          @ resume
54