1%def invoke(helper="UndefinedInvokeHandler"):
2    /*
3     * Generic invoke handler wrapper.
4     */
5    /* op vB, {vD, vE, vF, vG, vA}, class@CCCC */
6    /* op {vCCCC..v(CCCC+AA-1)}, meth@BBBB */
7    .extern $helper
8    EXPORT_PC()
9    move    a0, rSELF
10    addu    a1, rFP, OFF_FP_SHADOWFRAME
11    move    a2, rPC
12    move    a3, rINST
13    JAL($helper)
14    beqz    v0, MterpException
15    FETCH_ADVANCE_INST(3)
16    JAL(MterpShouldSwitchInterpreters)
17    bnez    v0, MterpFallback
18    GET_INST_OPCODE(t0)
19    GOTO_OPCODE(t0)
20
21%def invoke_polymorphic(helper="UndefinedInvokeHandler"):
22    /*
23     * invoke-polymorphic handler wrapper.
24     */
25    /* op {vC, vD, vE, vF, vG}, meth@BBBB, proto@HHHH */
26    /* op {vCCCC..v(CCCC+AA-1)}, meth@BBBB, proto@HHHH */
27    .extern $helper
28    EXPORT_PC()
29    move    a0, rSELF
30    addu    a1, rFP, OFF_FP_SHADOWFRAME
31    move    a2, rPC
32    move    a3, rINST
33    JAL($helper)
34    beqz    v0, MterpException
35    FETCH_ADVANCE_INST(4)
36    JAL(MterpShouldSwitchInterpreters)
37    bnez    v0, MterpFallback
38    GET_INST_OPCODE(t0)
39    GOTO_OPCODE(t0)
40
41%def op_invoke_custom():
42%  invoke(helper="MterpInvokeCustom")
43
44%def op_invoke_custom_range():
45%  invoke(helper="MterpInvokeCustomRange")
46
47%def op_invoke_direct():
48%  invoke(helper="MterpInvokeDirect")
49
50%def op_invoke_direct_range():
51%  invoke(helper="MterpInvokeDirectRange")
52
53%def op_invoke_interface():
54%  invoke(helper="MterpInvokeInterface")
55
56%def op_invoke_interface_range():
57%  invoke(helper="MterpInvokeInterfaceRange")
58
59%def op_invoke_polymorphic():
60%  invoke_polymorphic(helper="MterpInvokePolymorphic")
61
62%def op_invoke_polymorphic_range():
63%  invoke_polymorphic(helper="MterpInvokePolymorphicRange")
64
65%def op_invoke_static():
66%  invoke(helper="MterpInvokeStatic")
67
68%def op_invoke_static_range():
69%  invoke(helper="MterpInvokeStaticRange")
70
71%def op_invoke_super():
72%  invoke(helper="MterpInvokeSuper")
73
74%def op_invoke_super_range():
75%  invoke(helper="MterpInvokeSuperRange")
76
77%def op_invoke_virtual():
78%  invoke(helper="MterpInvokeVirtual")
79
80%def op_invoke_virtual_quick():
81%  invoke(helper="MterpInvokeVirtualQuick")
82
83%def op_invoke_virtual_range():
84%  invoke(helper="MterpInvokeVirtualRange")
85
86%def op_invoke_virtual_range_quick():
87%  invoke(helper="MterpInvokeVirtualQuickRange")
88