michael@0: /* -*- Mode: asm; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- michael@0: * Version: MPL 1.1 michael@0: * michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /* This code is for MIPS using the O32 ABI. */ michael@0: michael@0: #include michael@0: #include michael@0: michael@0: .text michael@0: .globl PrepareAndDispatch michael@0: michael@0: NARGSAVE=4 # extra space for the callee to use. gccism michael@0: # we can put our a0-a3 in our callers space. michael@0: LOCALSZ=2 # gp, ra michael@0: FRAMESZ=(((NARGSAVE+LOCALSZ)*SZREG)+ALSZ)&ALMASK michael@0: michael@0: define(STUB_NAME, `Stub'$1`__14nsXPTCStubBase') michael@0: michael@0: define(STUB_ENTRY, michael@0: ` .globl 'STUB_NAME($1)` michael@0: .align 2 michael@0: .type 'STUB_NAME($1)`,@function michael@0: .ent 'STUB_NAME($1)`, 0 michael@0: 'STUB_NAME($1)`: michael@0: .frame sp, FRAMESZ, ra michael@0: .set noreorder michael@0: .cpload t9 michael@0: .set reorder michael@0: subu sp, FRAMESZ michael@0: .cprestore 16 michael@0: li t0, '$1` michael@0: b sharedstub michael@0: .end 'STUB_NAME($1)` michael@0: michael@0: ') michael@0: michael@0: define(SENTINEL_ENTRY, `') michael@0: michael@0: include(xptcstubsdef.inc) michael@0: michael@0: .globl sharedstub michael@0: .ent sharedstub michael@0: sharedstub: michael@0: michael@0: REG_S ra, 20(sp) michael@0: michael@0: REG_S a0, 24(sp) michael@0: REG_S a1, 28(sp) michael@0: REG_S a2, 32(sp) michael@0: REG_S a3, 36(sp) michael@0: michael@0: # t0 is methodIndex michael@0: move a1, t0 michael@0: michael@0: # put the start of a1, a2, a3, and stack michael@0: move a2, sp michael@0: addi a2, 24 # have a2 point to sp + 24 (where a0 is) michael@0: michael@0: # PrepareAndDispatch(that, methodIndex, args) michael@0: # a0 a1 a2 michael@0: # michael@0: jal PrepareAndDispatch michael@0: michael@0: REG_L ra, 20(sp) michael@0: REG_L a1, 28(sp) michael@0: REG_L a2, 32(sp) michael@0: michael@0: addu sp, FRAMESZ michael@0: j ra michael@0: michael@0: .end sharedstub