• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1%default { "jumbo":"0", "cccc":"2" }
2%verify "executed"
3%verify "finalizable class"
4    /*
5     * Invoke Object.<init> on an object.  In practice we know that
6     * Object's nullary constructor doesn't do anything, so we just
7     * skip it unless a debugger is active.
8     */
9    FETCH(r1, ${cccc})                  @ r1<- CCCC
10    GET_VREG(r0, r1)                    @ r0<- "this" ptr
11    cmp     r0, #0                      @ check for NULL
12    beq     common_errNullObject        @ export PC and throw NPE
13    ldr     r1, [r0, #offObject_clazz]  @ r1<- obj->clazz
14    ldr     r2, [r1, #offClassObject_accessFlags] @ r2<- clazz->accessFlags
15    tst     r2, #CLASS_ISFINALIZABLE    @ is this class finalizable?
16    bne     .L${opcode}_setFinal        @ yes, go
17.L${opcode}_finish:
18    ldrh    r1, [rSELF, #offThread_subMode]
19    ands    r1, #kSubModeDebuggerActive @ debugger active?
20    bne     .L${opcode}_debugger        @ Yes - skip optimization
21    FETCH_ADVANCE_INST(${cccc}+1)       @ advance to next instr, load rINST
22    GET_INST_OPCODE(ip)                 @ ip<- opcode from rINST
23    GOTO_OPCODE(ip)                     @ execute it
24%break
25
26.L${opcode}_setFinal:
27    EXPORT_PC()                         @ can throw
28    bl      dvmSetFinalizable           @ call dvmSetFinalizable(obj)
29    ldr     r0, [rSELF, #offThread_exception] @ r0<- self->exception
30    cmp     r0, #0                      @ exception pending?
31    bne     common_exceptionThrown      @ yes, handle it
32    b       .L${opcode}_finish
33
34    /*
35     * A debugger is attached, so we need to go ahead and do
36     * this.  For simplicity, we'll just jump directly to the
37     * corresponding handler.  Note that we can't use
38     * rIBASE here because it may be in single-step mode.
39     * Load the primary table base directly.
40     */
41.L${opcode}_debugger:
42    ldr     r1, [rSELF, #offThread_mainHandlerTable]
43    mov     ip, #OP_INVOKE_DIRECT_RANGE
44    GOTO_OPCODE_BASE(r1,ip)             @ execute it
45