1
/* -*- Mode: asm; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
4
* The contents of this file are subject to the Mozilla Public License Version
5
* 1.1 (the "License"); you may not use this file except in compliance with
6
* the License. You may obtain a copy of the License at
7
* http://www.mozilla.org/MPL/
9
* Software distributed under the License is distributed on an "AS IS" basis,
10
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11
* for the specific language governing rights and limitations under the
14
* The Original Code is mozilla.org code.
16
* The Initial Developer of the Original Code is
17
* Netscape Communications Corp, Inc.
18
* Portions created by the Initial Developer are Copyright (C) 2001
19
* the Initial Developer. All Rights Reserved.
22
* Stuart Parmenter <pavlov@netscape.com>
23
* Chris Waterson <waterson@netscape.com>
24
* Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
27
/* This code is for MIPS using the O32 ABI. */
29
#include <sys/regdef.h>
32
# NARGSAVE is the argument space in the callers frame, including extra
33
# 'shadowed' space for the argument registers. The minimum of 4
34
# argument slots is sometimes predefined in the header files.
39
#define LOCALSZ 2 /* gp, ra */
40
#define FRAMESZ ((((NARGSAVE+LOCALSZ)*SZREG)+ALSZ)&ALMASK)
42
#define RAOFF (FRAMESZ - (1*SZREG))
43
#define GPOFF (FRAMESZ - (2*SZREG))
45
#define A0OFF (FRAMESZ + (0*SZREG))
46
#define A1OFF (FRAMESZ + (1*SZREG))
47
#define A2OFF (FRAMESZ + (2*SZREG))
48
#define A3OFF (FRAMESZ + (3*SZREG))
52
#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
53
#define STUB_ENTRY(x) \
55
.globl _ZN14nsXPTCStubBase5Stub ##x ##Ev; \
56
.type _ZN14nsXPTCStubBase5Stub ##x ##Ev,@function; \
57
.aent _ZN14nsXPTCStubBase5Stub ##x ##Ev,0; \
58
_ZN14nsXPTCStubBase5Stub ##x ##Ev:; \
63
.globl _ZN14nsXPTCStubBase6Stub ##x ##Ev; \
64
.type _ZN14nsXPTCStubBase6Stub ##x ##Ev,@function; \
65
.aent _ZN14nsXPTCStubBase6Stub ##x ##Ev,0; \
66
_ZN14nsXPTCStubBase6Stub ##x ##Ev:; \
71
.globl _ZN14nsXPTCStubBase7Stub ##x ##Ev; \
72
.type _ZN14nsXPTCStubBase7Stub ##x ##Ev,@function; \
73
.aent _ZN14nsXPTCStubBase7Stub ##x ##Ev,0; \
74
_ZN14nsXPTCStubBase7Stub ##x ##Ev:; \
81
#else /* not G++ V3 ABI */
82
#define STUB_ENTRY(x) \
83
.globl Stub ##x ##__14nsXPTCStubBase; \
84
.type Stub ##x ##__14nsXPTCStubBase,@function; \
85
.aent Stub ##x ##__14nsXPTCStubBase,0; \
86
Stub ##x ##__14nsXPTCStubBase:; \
90
#endif /* G++ V3 ABI */
92
# SENTINEL_ENTRY is handled in the cpp file.
93
#define SENTINEL_ENTRY(x)
96
# open a dummy frame for the function entries
101
.frame sp, FRAMESZ, ra
105
#include "xptcstubsdef.inc"
110
# specify the save register mask for gp, ra, a0-a3
111
.mask 0x900000F0, RAOFF-FRAMESZ
116
# Micro-optimization: a0 is already loaded, and its slot gets
117
# ignored by PrepareAndDispatch, so no need to save it here.
123
la t9, PrepareAndDispatch
127
# have a2 point to the begin of the argument space on stack
128
addiu a2, sp, FRAMESZ
130
# PrepareAndDispatch(that, methodIndex, args)
133
# Micro-optimization: Using jalr explicitly has the side-effect
134
# of not triggering .cprestore. This is ok because we have no
135
# gp reference below this point. It also allows better
136
# instruction sscheduling.