~ubuntu-branches/ubuntu/precise/firefox/precise-proposed

« back to all changes in this revision

Viewing changes to xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_mips.s

  • Committer: Bazaar Package Importer
  • Author(s): Ian Jackson
  • Date: 2005-12-02 20:16:18 UTC
  • Revision ID: james.westby@ubuntu.com-20051202201618-txu8o1sikp5e3by5
Tags: 1.4.99+1.5rc3.dfsg-1ubuntu4
* Applied mozilla-1.7.12-2.src.rpm's firefox-1.0-uriloader.patch
  which causes firefox to look first in the Gnome MIME handling registry
  (MIME handling is still very wrong).
* Disabled File / Import from main menu since it does not work at all
  (Ubuntu bugzilla 10339 still applies; patch brought forward).
* Displayed printer names no longer show `CUPS/' prefix.
  (Ubuntu bugzilla 11481 regressed; patch from Breezy enhanced).
* Print command fixed (again) to cope with spaces in printer names.
* Remove incorrect note about Pango from README.Debian.
* Re-fix-up localised startup URLs in en-US region.properties.
* Fix incorrect layout/sizing in Help / About box (a bit hacky).
* Re-forward-port patch to fix printer names with spaces.
* Remove all subdirectories '*.OBJ' during clean.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: asm; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 
2
 * Version: MPL 1.1
 
3
 *
 
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/
 
8
 *
 
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
 
12
 * License.
 
13
 *
 
14
 * The Original Code is mozilla.org code.
 
15
 *
 
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.
 
20
 *
 
21
 * Contributor(s):
 
22
 *   Stuart Parmenter <pavlov@netscape.com>
 
23
 *   Chris Waterson   <waterson@netscape.com>
 
24
 *   Thiemo Seufer    <seufer@csv.ica.uni-stuttgart.de>
 
25
 */
 
26
 
 
27
/* This code is for MIPS using the O32 ABI. */
 
28
 
 
29
#include <sys/regdef.h>
 
30
#include <sys/asm.h>
 
31
 
 
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.
 
35
#ifndef NARGSAVE
 
36
#define NARGSAVE 4
 
37
#endif
 
38
 
 
39
#define LOCALSZ 2       /* gp, ra */
 
40
#define FRAMESZ ((((NARGSAVE+LOCALSZ)*SZREG)+ALSZ)&ALMASK)
 
41
 
 
42
#define RAOFF (FRAMESZ - (1*SZREG))
 
43
#define GPOFF (FRAMESZ - (2*SZREG))
 
44
 
 
45
#define A0OFF (FRAMESZ + (0*SZREG))
 
46
#define A1OFF (FRAMESZ + (1*SZREG))
 
47
#define A2OFF (FRAMESZ + (2*SZREG))
 
48
#define A3OFF (FRAMESZ + (3*SZREG))
 
49
 
 
50
        .text
 
51
 
 
52
#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
 
53
#define STUB_ENTRY(x)                                           \
 
54
        .if x < 10;                                             \
 
55
        .globl  _ZN14nsXPTCStubBase5Stub ##x ##Ev;              \
 
56
        .type   _ZN14nsXPTCStubBase5Stub ##x ##Ev,@function;    \
 
57
        .aent   _ZN14nsXPTCStubBase5Stub ##x ##Ev,0;            \
 
58
_ZN14nsXPTCStubBase5Stub ##x ##Ev:;                             \
 
59
        SETUP_GP;                                               \
 
60
        li      t0,x;                                           \
 
61
        b       sharedstub;                                     \
 
62
        .elseif x < 100;                                        \
 
63
        .globl  _ZN14nsXPTCStubBase6Stub ##x ##Ev;              \
 
64
        .type   _ZN14nsXPTCStubBase6Stub ##x ##Ev,@function;    \
 
65
        .aent   _ZN14nsXPTCStubBase6Stub ##x ##Ev,0;            \
 
66
_ZN14nsXPTCStubBase6Stub ##x ##Ev:;                             \
 
67
        SETUP_GP;                                               \
 
68
        li      t0,x;                                           \
 
69
        b       sharedstub;                                     \
 
70
        .elseif x < 1000;                                       \
 
71
        .globl  _ZN14nsXPTCStubBase7Stub ##x ##Ev;              \
 
72
        .type   _ZN14nsXPTCStubBase7Stub ##x ##Ev,@function;    \
 
73
        .aent   _ZN14nsXPTCStubBase7Stub ##x ##Ev,0;            \
 
74
_ZN14nsXPTCStubBase7Stub ##x ##Ev:;                             \
 
75
        SETUP_GP;                                               \
 
76
        li      t0,x;                                           \
 
77
        b       sharedstub;                                     \
 
78
        .else;                                                  \
 
79
        .err;                                                   \
 
80
        .endif
 
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:;                                 \
 
87
        SETUP_GP;                                               \
 
88
        li      t0,x;                                           \
 
89
        b       sharedstub
 
90
#endif /* G++ V3 ABI */
 
91
 
 
92
# SENTINEL_ENTRY is handled in the cpp file.
 
93
#define SENTINEL_ENTRY(x)
 
94
 
 
95
#
 
96
# open a dummy frame for the function entries
 
97
#
 
98
        .align  2
 
99
        .type   dummy,@function
 
100
        .ent    dummy, 0
 
101
        .frame  sp, FRAMESZ, ra 
 
102
dummy:
 
103
        SETUP_GP
 
104
 
 
105
#include "xptcstubsdef.inc"
 
106
 
 
107
sharedstub:
 
108
        subu    sp, FRAMESZ
 
109
 
 
110
        # specify the save register mask for gp, ra, a0-a3
 
111
        .mask 0x900000F0, RAOFF-FRAMESZ
 
112
 
 
113
        sw      ra, RAOFF(sp)
 
114
        SAVE_GP(GPOFF)
 
115
 
 
116
        # Micro-optimization: a0 is already loaded, and its slot gets
 
117
        # ignored by PrepareAndDispatch, so no need to save it here.
 
118
        # sw    a0, A0OFF(sp)
 
119
        sw      a1, A1OFF(sp)
 
120
        sw      a2, A2OFF(sp)
 
121
        sw      a3, A3OFF(sp)
 
122
 
 
123
        la      t9, PrepareAndDispatch
 
124
 
 
125
        # t0 is methodIndex
 
126
        move    a1, t0
 
127
        # have a2 point to the begin of the argument space on stack
 
128
        addiu   a2, sp, FRAMESZ
 
129
 
 
130
        # PrepareAndDispatch(that, methodIndex, args)
 
131
        jalr    t9
 
132
 
 
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.
 
137
        # lw    gp, GPOFF(fp)
 
138
 
 
139
        lw      ra, RAOFF(sp)
 
140
        addiu   sp, FRAMESZ
 
141
        j       ra
 
142
        END(dummy)