OP_CONST_STRING.S revision 89c1feb0a69a7707b271086e749975b3f7acacf7
1%verify "executed"
2%verify "String already resolved"
3%verify "String not yet resolved"
4%verify "String cannot be resolved"
5    /* const/string vAA, String@BBBB */
6    FETCH(r1, 1)                        @ r1<- BBBB
7    ldr     r2, [rGLUE, #offGlue_methodClassDex]    @ r2<- glue->methodClassDex
8    mov     r9, rINST, lsr #8           @ r9<- AA
9    ldr     r2, [r2, #offDvmDex_pResStrings]   @ r2<- dvmDex->pResStrings
10    ldr     r0, [r2, r1, lsl #2]        @ r0<- pResStrings[BBBB]
11    cmp     r0, #0                      @ not yet resolved?
12    beq     .L${opcode}_resolve
13    FETCH_ADVANCE_INST(2)               @ advance rPC, load rINST
14    GET_INST_OPCODE(ip)                 @ extract opcode from rINST
15    SET_VREG(r0, r9)                    @ vAA<- r0
16    GOTO_OPCODE(ip)                     @ jump to next instruction
17%break
18
19    /*
20     * Continuation if the String has not yet been resolved.
21     *  r1: BBBB (String ref)
22     *  r9: target register
23     */
24.L${opcode}_resolve:
25    EXPORT_PC()
26    ldr     r0, [rGLUE, #offGlue_method] @ r0<- glue->method
27    ldr     r0, [r0, #offMethod_clazz]  @ r0<- method->clazz
28    bl      dvmResolveString            @ r0<- String reference
29    cmp     r0, #0                      @ failed?
30    beq     common_exceptionThrown      @ yup, handle the exception
31    FETCH_ADVANCE_INST(2)               @ advance rPC, load rINST
32    GET_INST_OPCODE(ip)                 @ extract opcode from rINST
33    SET_VREG(r0, r9)                    @ vAA<- r0
34    GOTO_OPCODE(ip)                     @ jump to next instruction
35
36