OP_INVOKE_OBJECT_INIT_RANGE.S revision a8b91c52fd8a90b784835dfe1f8898035266c4dd
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(a1, ${cccc})                  # a1<- CCCC
10    GET_VREG(a0, a1)                    # a0<- "this" ptr
11    # check for NULL
12    beqz    a0, common_errNullObject    # export PC and throw NPE
13    LOAD_base_offObject_clazz(a1, a0)   # a1<- obj->clazz
14    LOAD_base_offClassObject_accessFlags(a2, a1) # a2<- clazz->accessFlags
15    and     a2, CLASS_ISFINALIZABLE     # is this class finalizable?
16    beqz    a2, .L${opcode}_finish      # no, go
17
18.L${opcode}_setFinal:
19    EXPORT_PC()                         # can throw
20    JAL(dvmSetFinalizable)              # call dvmSetFinalizable(obj)
21    LOAD_offThread_exception(a0, rSELF)	# a0<- self->exception
22    # exception pending?
23    bnez    a0, common_exceptionThrown  # yes, handle it
24
25.L${opcode}_finish:
26    lhu     a1, offThread_subMode(rSELF)
27    and     a1, kSubModeDebuggerActive  # debugger active?
28    bnez    a1, .L${opcode}_debugger    # Yes - skip optimization
29    FETCH_ADVANCE_INST(${cccc}+1)       # advance to next instr, load rINST
30    GET_INST_OPCODE(t0)                 # t0<- opcode from rINST
31    GOTO_OPCODE(t0)                     # execute it
32
33%break
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    lw      a1, offThread_mainHandlerTable(rSELF)
43    .if $jumbo
44    li      t0, OP_INVOKE_DIRECT_JUMBO
45    .else
46    li      t0, OP_INVOKE_DIRECT_RANGE
47    .endif
48    GOTO_OPCODE_BASE(a1, t0)            # execute it
49