1 |
armin76 08/09/09 15:48:43 |
2 |
|
3 |
Added: 020_noxul-mips-asm.patch 021_noxul-mips-fpic.patch |
4 |
030-firefox_encode_spaces.patch |
5 |
Removed: 006_mips-asm.patch 008_mips-fpic.patch |
6 |
Log: |
7 |
Move patches, add new one |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 src/patchsets/mozilla-firefox/3.0.1/020_noxul-mips-asm.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/mozilla-firefox/3.0.1/020_noxul-mips-asm.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/mozilla-firefox/3.0.1/020_noxul-mips-asm.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: 020_noxul-mips-asm.patch |
16 |
=================================================================== |
17 |
Upstream Bug: http://bugzilla.mozilla.org/show_bug.cgi?id=258429 |
18 |
|
19 |
This patch is required to fix build issues with Mozilla on MIPS architectures. |
20 |
The out-of-the-box code is coded to build on a PlayStation 2 game console, which |
21 |
is a highly specialised MIPS machine based around the Toshiba TX5900. This CPU |
22 |
is very non-standard, causing problems with generic MIPS machines like Silicon |
23 |
Graphics workstations. |
24 |
|
25 |
The following patch fixes the assembly language routines for generic MIPS |
26 |
machines. In the case where it is being compiled for a PlayStation 2, the older |
27 |
PS2-specific implementation is used instead. |
28 |
|
29 |
Patch $Revision: 1.1 $ |
30 |
diff --git a/configure.in b/configure.in |
31 |
index f49bf6c..2423b6c 100644 |
32 |
--- a/configure.in |
33 |
+++ b/configure.in |
34 |
@@ -1806,8 +1806,7 @@ case "$target" in |
35 |
MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS=1 |
36 |
;; |
37 |
mips*) |
38 |
- CFLAGS="$CFLAGS -Wa,-xgot" |
39 |
- CXXFLAGS="$CXXFLAGS -Wa,-xgot" |
40 |
+ MOZ_DEBUG_FLAGS="-g" # We want inlining |
41 |
;; |
42 |
esac |
43 |
;; |
44 |
diff --git a/xpcom/reflect/xptcall/src/md/unix/Makefile.in b/xpcom/reflect/xptcall/src/md/unix/Makefile.in |
45 |
index 559fd96..6181699 100644 |
46 |
--- a/xpcom/reflect/xptcall/src/md/unix/Makefile.in |
47 |
+++ b/xpcom/reflect/xptcall/src/md/unix/Makefile.in |
48 |
@@ -276,11 +276,7 @@ ifeq ($(OS_ARCH),Linux) |
49 |
ifneq (,$(findstring mips, $(OS_TEST))) |
50 |
CPPSRCS := xptcinvoke_mips.cpp xptcstubs_mips.cpp |
51 |
ASFILES := xptcinvoke_asm_mips.s xptcstubs_asm_mips.s |
52 |
-#xptcstubs_mips.cpp |
53 |
-# xptcstubs_asm_mips.s |
54 |
-ifdef GNU_CC |
55 |
-ASFLAGS += $(INCLUDES) -x assembler-with-cpp -D__GNUC__ |
56 |
-endif |
57 |
+ASFLAGS += -I$(PUBLIC) -x assembler-with-cpp |
58 |
endif |
59 |
endif |
60 |
|
61 |
@@ -466,10 +462,7 @@ LOCAL_INCLUDES += \ |
62 |
|
63 |
ifeq ($(OS_ARCH),Linux) |
64 |
ifneq (,$(findstring mips, $(OS_TEST))) |
65 |
-xptcstubs_asm_mips.o: xptcstubs_asm_mips.s.m4 $(PUBLIC)/xptcstubsdef.inc |
66 |
- m4 $(INCLUDES) $< > ./xptcstubs_asm_mips.s && \ |
67 |
- $(AS) -o $@ $(ASFLAGS) $(AS_DASH_C_FLAG) ./xptcstubs_asm_mips.s |
68 |
- $(RM) -f ./xptcstubs_asm_mips.s |
69 |
+xptcstubs_asm_mips.o: $(PUBLIC)/xptcstubsdef.inc |
70 |
endif |
71 |
endif |
72 |
|
73 |
diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips.s b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips.s |
74 |
index 8704247..6cf9deb 100644 |
75 |
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips.s |
76 |
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips.s |
77 |
@@ -24,6 +24,7 @@ |
78 |
* Contributor(s): |
79 |
* Brendan Eich <brendan@×××××××.org> |
80 |
* Stuart Parmenter <pavlov@××××××××.com> |
81 |
+ * Thiemo Seufer <seufer@×××××××××××××××××××××.de> |
82 |
* |
83 |
* Alternatively, the contents of this file may be used under the terms of |
84 |
* either the GNU General Public License Version 2 or later (the "GPL"), or |
85 |
@@ -44,139 +45,123 @@ |
86 |
#include <sys/regdef.h> |
87 |
#include <sys/asm.h> |
88 |
|
89 |
-.text |
90 |
-.globl invoke_count_words |
91 |
-.globl invoke_copy_to_stack |
92 |
- |
93 |
-# We need a variable number of words allocated from the stack for copies of |
94 |
-# the params, and this space must come between the high frame (where ra, gp, |
95 |
-# and s0 are saved) and the low frame (where a0-a3 are saved by the callee |
96 |
-# functions we invoke). |
97 |
- |
98 |
-LOCALSZ=4 # s0, s1, ra, gp |
99 |
-NARGSAVE=4 # a0, a1, a2, a3 |
100 |
-HIFRAMESZ=(LOCALSZ*SZREG) |
101 |
-LOFRAMESZ=(NARGSAVE*SZREG) |
102 |
-FRAMESZ=(HIFRAMESZ+LOFRAMESZ+ALSZ)&ALMASK |
103 |
- |
104 |
-# XXX these 2*SZREG, etc. are very magic -- we *know* that ALSZ&ALMASK cause |
105 |
-# FRAMESZ to be 0 mod 8, in this case to be 16 and not 12. |
106 |
-RAOFF=FRAMESZ - (2*SZREG) |
107 |
-GPOFF=FRAMESZ - (3*SZREG) |
108 |
-S0OFF=FRAMESZ - (4*SZREG) |
109 |
-S1OFF=FRAMESZ - (5*SZREG) |
110 |
- |
111 |
-# These are not magic -- they are just our argsave slots in the caller frame. |
112 |
-A0OFF=FRAMESZ |
113 |
-A1OFF=FRAMESZ + (1*SZREG) |
114 |
-A2OFF=FRAMESZ + (2*SZREG) |
115 |
-A3OFF=FRAMESZ + (3*SZREG) |
116 |
- |
117 |
- # |
118 |
- # _XPTC_InvokeByIndex(that, methodIndex, paramCount, params) |
119 |
- # a0 a1 a2 a3 |
120 |
- |
121 |
-NESTED(_XPTC_InvokeByIndex, FRAMESZ, ra) |
122 |
- |
123 |
- .set noreorder |
124 |
- .cpload t9 |
125 |
- .set reorder |
126 |
- |
127 |
+# NARGSAVE is the argument space in the callers frame, including extra |
128 |
+# 'shadowed' space for the argument registers. The minimum of 4 |
129 |
+# argument slots is sometimes predefined in the header files. |
130 |
+#ifndef NARGSAVE |
131 |
+#define NARGSAVE 4 |
132 |
+#endif |
133 |
+ |
134 |
+#define LOCALSZ 3 /* gp, fp, ra */ |
135 |
+#define FRAMESZ ((((NARGSAVE+LOCALSZ)*SZREG)+ALSZ)&ALMASK) |
136 |
+ |
137 |
+#define RAOFF (FRAMESZ - (1*SZREG)) |
138 |
+#define FPOFF (FRAMESZ - (2*SZREG)) |
139 |
+#define GPOFF (FRAMESZ - (3*SZREG)) |
140 |
+ |
141 |
+#define A0OFF (FRAMESZ + (0*SZREG)) |
142 |
+#define A1OFF (FRAMESZ + (1*SZREG)) |
143 |
+#define A2OFF (FRAMESZ + (2*SZREG)) |
144 |
+#define A3OFF (FRAMESZ + (3*SZREG)) |
145 |
+ |
146 |
+ .text |
147 |
+ |
148 |
+# |
149 |
+# _NS_InvokeByIndex_P(that, methodIndex, paramCount, params) |
150 |
+# a0 a1 a2 a3 |
151 |
+ |
152 |
+ .globl _NS_InvokeByIndex_P |
153 |
+ .align 2 |
154 |
+ .type _NS_InvokeByIndex_P,@function |
155 |
+ .ent _NS_InvokeByIndex_P,0 |
156 |
+ .frame fp, FRAMESZ, ra |
157 |
+_NS_InvokeByIndex_P: |
158 |
+ SETUP_GP |
159 |
subu sp, FRAMESZ |
160 |
|
161 |
- # specify the save register mask -- XXX do we want the a0-a3 here, given |
162 |
- # our "split" frame where the args are saved below a dynamicly allocated |
163 |
- # region under the high frame? |
164 |
- # |
165 |
- # 10010000000000010000000011110000 |
166 |
- .mask 0x900100F0, -((NARGSAVE+LOCALSZ)*SZREG) |
167 |
+ # specify the save register mask for gp, fp, ra, a3 - a0 |
168 |
+ .mask 0xD00000F0, RAOFF-FRAMESZ |
169 |
|
170 |
- # thou shalt not use .cprestore if yer frame has variable size... |
171 |
- # .cprestore GPOFF |
172 |
+ sw ra, RAOFF(sp) |
173 |
+ sw fp, FPOFF(sp) |
174 |
|
175 |
- REG_S ra, RAOFF(sp) |
176 |
+ # we can't use .cprestore in a variable stack frame |
177 |
+ sw gp, GPOFF(sp) |
178 |
|
179 |
- # this happens automatically with .cprestore, but we cannot use that op... |
180 |
- REG_S gp, GPOFF(sp) |
181 |
- REG_S s0, S0OFF(sp) |
182 |
- REG_S s1, S1OFF(sp) |
183 |
+ sw a0, A0OFF(sp) |
184 |
+ sw a1, A1OFF(sp) |
185 |
+ sw a2, A2OFF(sp) |
186 |
+ sw a3, A3OFF(sp) |
187 |
|
188 |
- REG_S a0, A0OFF(sp) |
189 |
- REG_S a1, A1OFF(sp) |
190 |
- REG_S a2, A2OFF(sp) |
191 |
- REG_S a3, A3OFF(sp) |
192 |
+ # save bottom of fixed frame |
193 |
+ move fp, sp |
194 |
|
195 |
- # invoke_count_words(paramCount, params) |
196 |
+ # extern "C" uint32 |
197 |
+ # invoke_count_words(PRUint32 paramCount, nsXPTCVariant* s); |
198 |
+ la t9, invoke_count_words |
199 |
move a0, a2 |
200 |
move a1, a3 |
201 |
- |
202 |
- jal invoke_count_words |
203 |
- lw gp, GPOFF(sp) |
204 |
- |
205 |
- # save the old sp so we can pop the param area and any "low frame" |
206 |
- # needed as an argsave area below the param block for callees that |
207 |
- # we invoke. |
208 |
- move s0, sp |
209 |
- |
210 |
- REG_L a1, A2OFF(sp) # a1 = paramCount |
211 |
- REG_L a2, A3OFF(sp) # a2 = params |
212 |
- |
213 |
- # we define a word as 4 bytes, period end of story! |
214 |
- sll v0, 2 # 4 bytes * result of invoke_copy_words |
215 |
- subu v0, LOFRAMESZ # but we take back the argsave area built into |
216 |
- # our stack frame -- SWEET! |
217 |
- subu sp, sp, v0 # make room |
218 |
- move a0, sp # a0 = param stack address |
219 |
- move s1, a0 # save it for later -- it should be safe here |
220 |
- |
221 |
- # the old sp is still saved in s0, but we now need another argsave |
222 |
- # area ("low frame") for the invoke_copy_to_stack call. |
223 |
- subu sp, sp, LOFRAMESZ |
224 |
- |
225 |
- # copy the param into the stack areas |
226 |
+ jalr t9 |
227 |
+ lw gp, GPOFF(fp) |
228 |
+ |
229 |
+ # allocate variable stack, with a size of: |
230 |
+ # wordsize (of 4 bytes) * result (already aligned to dword) |
231 |
+ # but a minimum of 16 byte |
232 |
+ sll v0, 2 |
233 |
+ slt t0, v0, 16 |
234 |
+ beqz t0, 1f |
235 |
+ li v0, 16 |
236 |
+1: subu sp, v0 |
237 |
+ |
238 |
+ # let a0 point to the bottom of the variable stack, allocate |
239 |
+ # another fixed stack for: |
240 |
+ # extern "C" void |
241 |
# invoke_copy_to_stack(PRUint32* d, PRUint32 paramCount, |
242 |
- # nsXPTCVariant* s) |
243 |
- jal invoke_copy_to_stack |
244 |
- lw gp, GPOFF(s0) |
245 |
- |
246 |
- move sp, s0 # get orig sp back, popping params and argsave |
247 |
- |
248 |
- REG_L a0, A0OFF(sp) # a0 = set "that" to be "this" |
249 |
- REG_L a1, A1OFF(sp) # a1 = methodIndex |
250 |
- |
251 |
- # t1 = methodIndex * 4 |
252 |
- # (use shift instead of mult) |
253 |
- sll t1, a1, 2 |
254 |
- |
255 |
- # calculate the function we need to jump to, |
256 |
- # which must then be saved in t9 |
257 |
+ # nsXPTCVariant* s); |
258 |
+ la t9, invoke_copy_to_stack |
259 |
+ move a0, sp |
260 |
+ lw a1, A2OFF(fp) |
261 |
+ lw a2, A3OFF(fp) |
262 |
+ subu sp, 16 |
263 |
+ jalr t9 |
264 |
+ lw gp, GPOFF(fp) |
265 |
+ |
266 |
+ # back to the variable stack frame |
267 |
+ addu sp, 16 |
268 |
+ |
269 |
+ # calculate the function we need to jump to, which must then be |
270 |
+ # stored in t9 |
271 |
+ lw a0, A0OFF(fp) # a0 = set "that" to be "this" |
272 |
+ lw t0, A1OFF(fp) # a1 = methodIndex |
273 |
lw t9, 0(a0) |
274 |
- addu t9, t9, t1 |
275 |
- lw t9, 8(t9) |
276 |
- |
277 |
- # a1..a3 and f13..f14 should now be set to what |
278 |
- # invoke_copy_to_stack told us. skip a0 and f12 |
279 |
- # because that is the "this" pointer |
280 |
- |
281 |
- REG_L a1, 1*SZREG(s1) |
282 |
- REG_L a2, 2*SZREG(s1) |
283 |
- REG_L a3, 3*SZREG(s1) |
284 |
- |
285 |
- l.d $f13, 8(s1) |
286 |
- l.d $f14, 16(s1) |
287 |
- |
288 |
- # Create the stack pointer for the function, which must have 4 words |
289 |
- # of space for callee-saved args. invoke_count_words allocated space |
290 |
- # for a0 starting at s1, so we just move s1 into sp. |
291 |
- move sp, s1 |
292 |
- |
293 |
- jalr ra, t9 |
294 |
- lw gp, GPOFF(s0) |
295 |
- |
296 |
- move sp, s0 |
297 |
- |
298 |
- REG_L ra, RAOFF(sp) |
299 |
- REG_L s0, S0OFF(sp) |
300 |
- addu sp, FRAMESZ |
301 |
+ # t0 = methodIndex << PTRLOG |
302 |
+ sll t0, t0, PTRLOG |
303 |
+ addu t9, t0 |
304 |
+#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */ |
305 |
+ lw t9, (t9) |
306 |
+#else /* not G++ V3 ABI */ |
307 |
+ lw t9, 2*PTRSIZE(t9) |
308 |
+#endif /* G++ V3 ABI */ |
309 |
+ |
310 |
+ # Set a1-a3 to what invoke_copy_to_stack told us. a0 is already |
311 |
+ # the "this" pointer. We don't have to care about floating |
312 |
+ # point arguments, the non-FP "this" pointer as first argument |
313 |
+ # means they'll never be used. |
314 |
+ lw a1, 1*SZREG(sp) |
315 |
+ lw a2, 2*SZREG(sp) |
316 |
+ lw a3, 3*SZREG(sp) |
317 |
+ |
318 |
+ jalr t9 |
319 |
+ # Micro-optimization: There's no gp usage below this point, so |
320 |
+ # we don't reload. |
321 |
+ # lw gp, GPOFF(fp) |
322 |
+ |
323 |
+ # leave variable stack frame |
324 |
+ move sp, fp |
325 |
+ |
326 |
+ lw ra, RAOFF(sp) |
327 |
+ lw fp, FPOFF(sp) |
328 |
+ |
329 |
+ addiu sp, FRAMESZ |
330 |
j ra |
331 |
-.end _XPTC_InvokeByIndex |
332 |
+END(_NS_InvokeByIndex_P) |
333 |
diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_mips.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_mips.cpp |
334 |
index a73e432..2c27a26 100644 |
335 |
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_mips.cpp |
336 |
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_mips.cpp |
337 |
@@ -24,6 +24,7 @@ |
338 |
* Contributor(s): |
339 |
* Stuart Parmenter <pavlov@××××××××.com> |
340 |
* Brendan Eich <brendan@×××××××.org> |
341 |
+ * Thiemo Seufer <seufer@×××××××××××××××××××××.de> |
342 |
* |
343 |
* Alternatively, the contents of this file may be used under the terms of |
344 |
* either of the GNU General Public License Version 2 or later (the "GPL"), |
345 |
@@ -52,10 +53,8 @@ invoke_count_words(PRUint32 paramCount, nsXPTCVariant* s) |
346 |
// Count a word for a0 even though it's never stored or loaded |
347 |
// We do this only for alignment of register pairs. |
348 |
PRUint32 result = 1; |
349 |
- for (PRUint32 i = 0; i < paramCount; i++, s++) |
350 |
+ for (PRUint32 i = 0; i < paramCount; i++, result++, s++) |
351 |
{ |
352 |
- result++; |
353 |
- |
354 |
if (s->IsPtrData()) |
355 |
continue; |
356 |
|
357 |
@@ -68,6 +67,9 @@ invoke_count_words(PRUint32 paramCount, nsXPTCVariant* s) |
358 |
result++; |
359 |
result++; |
360 |
break; |
361 |
+ |
362 |
+ default: |
363 |
+ break; |
364 |
} |
365 |
} |
366 |
return (result + 1) & ~(PRUint32)1; |
367 |
@@ -88,8 +90,6 @@ invoke_copy_to_stack(PRUint32* d, PRUint32 paramCount, |
368 |
continue; |
369 |
} |
370 |
|
371 |
- *((void**)d) = s->val.p; |
372 |
- |
373 |
switch(s->type) |
374 |
{ |
375 |
case nsXPTType::T_I64 : |
376 |
@@ -104,19 +104,20 @@ invoke_copy_to_stack(PRUint32* d, PRUint32 paramCount, |
377 |
if ((PRWord)d & 4) d++; |
378 |
*((double*) d) = s->val.d; d++; |
379 |
break; |
380 |
+ default: |
381 |
+ *((void**)d) = s->val.p; |
382 |
+ break; |
383 |
} |
384 |
} |
385 |
} |
386 |
|
387 |
-extern "C" nsresult _XPTC_InvokeByIndex(nsISupports* that, PRUint32 methodIndex, |
388 |
+extern "C" nsresult _NS_InvokeByIndex_P(nsISupports* that, PRUint32 methodIndex, |
389 |
PRUint32 paramCount, |
390 |
nsXPTCVariant* params); |
391 |
|
392 |
-extern "C" |
393 |
-XPTC_PUBLIC_API(nsresult) |
394 |
-XPTC_InvokeByIndex(nsISupports* that, PRUint32 methodIndex, |
395 |
+EXPORT_XPCOM_API(nsresult) |
396 |
+NS_InvokeByIndex_P(nsISupports* that, PRUint32 methodIndex, |
397 |
PRUint32 paramCount, nsXPTCVariant* params) |
398 |
{ |
399 |
- return _XPTC_InvokeByIndex(that, methodIndex, paramCount, params); |
400 |
-} |
401 |
- |
402 |
+ return _NS_InvokeByIndex_P(that, methodIndex, paramCount, params); |
403 |
+} |
404 |
diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_mips.s b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_mips.s |
405 |
new file mode 100644 |
406 |
index 0000000..c2dc0c7 |
407 |
--- /dev/null |
408 |
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_mips.s |
409 |
@@ -0,0 +1,142 @@ |
410 |
+/* -*- Mode: asm; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- |
411 |
+ * Version: MPL 1.1 |
412 |
+ * |
413 |
+ * The contents of this file are subject to the Mozilla Public License Version |
414 |
+ * 1.1 (the "License"); you may not use this file except in compliance with |
415 |
+ * the License. You may obtain a copy of the License at |
416 |
+ * http://www.mozilla.org/MPL/ |
417 |
+ * |
418 |
+ * Software distributed under the License is distributed on an "AS IS" basis, |
419 |
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License |
420 |
+ * for the specific language governing rights and limitations under the |
421 |
+ * License. |
422 |
+ * |
423 |
+ * The Original Code is mozilla.org code. |
424 |
+ * |
425 |
+ * The Initial Developer of the Original Code is |
426 |
+ * Netscape Communications Corp, Inc. |
427 |
+ * Portions created by the Initial Developer are Copyright (C) 2001 |
428 |
+ * the Initial Developer. All Rights Reserved. |
429 |
+ * |
430 |
+ * Contributor(s): |
431 |
+ * Stuart Parmenter <pavlov@××××××××.com> |
432 |
+ * Chris Waterson <waterson@××××××××.com> |
433 |
+ * Thiemo Seufer <seufer@×××××××××××××××××××××.de> |
434 |
+ */ |
435 |
+ |
436 |
+/* This code is for MIPS using the O32 ABI. */ |
437 |
+ |
438 |
+#include <sys/regdef.h> |
439 |
+#include <sys/asm.h> |
440 |
+ |
441 |
+# NARGSAVE is the argument space in the callers frame, including extra |
442 |
+# 'shadowed' space for the argument registers. The minimum of 4 |
443 |
+# argument slots is sometimes predefined in the header files. |
444 |
+#ifndef NARGSAVE |
445 |
+#define NARGSAVE 4 |
446 |
+#endif |
447 |
+ |
448 |
+#define LOCALSZ 2 /* gp, ra */ |
449 |
+#define FRAMESZ ((((NARGSAVE+LOCALSZ)*SZREG)+ALSZ)&ALMASK) |
450 |
+ |
451 |
+#define RAOFF (FRAMESZ - (1*SZREG)) |
452 |
+#define GPOFF (FRAMESZ - (2*SZREG)) |
453 |
+ |
454 |
+#define A0OFF (FRAMESZ + (0*SZREG)) |
455 |
+#define A1OFF (FRAMESZ + (1*SZREG)) |
456 |
+#define A2OFF (FRAMESZ + (2*SZREG)) |
457 |
+#define A3OFF (FRAMESZ + (3*SZREG)) |
458 |
+ |
459 |
+ .text |
460 |
+ |
461 |
+#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */ |
462 |
+#define STUB_ENTRY(x) \ |
463 |
+ .if x < 10; \ |
464 |
+ .globl _ZN14nsXPTCStubBase5Stub ##x ##Ev; \ |
465 |
+ .type _ZN14nsXPTCStubBase5Stub ##x ##Ev,@function; \ |
466 |
+ .aent _ZN14nsXPTCStubBase5Stub ##x ##Ev,0; \ |
467 |
+_ZN14nsXPTCStubBase5Stub ##x ##Ev:; \ |
468 |
+ SETUP_GP; \ |
469 |
+ li t0,x; \ |
470 |
+ b sharedstub; \ |
471 |
+ .elseif x < 100; \ |
472 |
+ .globl _ZN14nsXPTCStubBase6Stub ##x ##Ev; \ |
473 |
+ .type _ZN14nsXPTCStubBase6Stub ##x ##Ev,@function; \ |
474 |
+ .aent _ZN14nsXPTCStubBase6Stub ##x ##Ev,0; \ |
475 |
+_ZN14nsXPTCStubBase6Stub ##x ##Ev:; \ |
476 |
+ SETUP_GP; \ |
477 |
+ li t0,x; \ |
478 |
+ b sharedstub; \ |
479 |
+ .elseif x < 1000; \ |
480 |
+ .globl _ZN14nsXPTCStubBase7Stub ##x ##Ev; \ |
481 |
+ .type _ZN14nsXPTCStubBase7Stub ##x ##Ev,@function; \ |
482 |
+ .aent _ZN14nsXPTCStubBase7Stub ##x ##Ev,0; \ |
483 |
+_ZN14nsXPTCStubBase7Stub ##x ##Ev:; \ |
484 |
+ SETUP_GP; \ |
485 |
+ li t0,x; \ |
486 |
+ b sharedstub; \ |
487 |
+ .else; \ |
488 |
+ .err; \ |
489 |
+ .endif |
490 |
+#else /* not G++ V3 ABI */ |
491 |
+#define STUB_ENTRY(x) \ |
492 |
+ .globl Stub ##x ##__14nsXPTCStubBase; \ |
493 |
+ .type Stub ##x ##__14nsXPTCStubBase,@function; \ |
494 |
+ .aent Stub ##x ##__14nsXPTCStubBase,0; \ |
495 |
+Stub ##x ##__14nsXPTCStubBase:; \ |
496 |
+ SETUP_GP; \ |
497 |
+ li t0,x; \ |
498 |
+ b sharedstub |
499 |
+#endif /* G++ V3 ABI */ |
500 |
+ |
501 |
+# SENTINEL_ENTRY is handled in the cpp file. |
502 |
+#define SENTINEL_ENTRY(x) |
503 |
+ |
504 |
+# |
505 |
+# open a dummy frame for the function entries |
506 |
+# |
507 |
+ .align 2 |
508 |
+ .type dummy,@function |
509 |
+ .ent dummy, 0 |
510 |
+ .frame sp, FRAMESZ, ra |
511 |
+dummy: |
512 |
+ SETUP_GP |
513 |
+ |
514 |
+#include "xptcstubsdef.inc" |
515 |
+ |
516 |
+sharedstub: |
517 |
+ subu sp, FRAMESZ |
518 |
+ |
519 |
+ # specify the save register mask for gp, ra, a0-a3 |
520 |
+ .mask 0x900000F0, RAOFF-FRAMESZ |
521 |
+ |
522 |
+ sw ra, RAOFF(sp) |
523 |
+ SAVE_GP(GPOFF) |
524 |
+ |
525 |
+ # Micro-optimization: a0 is already loaded, and its slot gets |
526 |
+ # ignored by PrepareAndDispatch, so no need to save it here. |
527 |
+ # sw a0, A0OFF(sp) |
528 |
+ sw a1, A1OFF(sp) |
529 |
+ sw a2, A2OFF(sp) |
530 |
+ sw a3, A3OFF(sp) |
531 |
+ |
532 |
+ la t9, PrepareAndDispatch |
533 |
+ |
534 |
+ # t0 is methodIndex |
535 |
+ move a1, t0 |
536 |
+ # have a2 point to the begin of the argument space on stack |
537 |
+ addiu a2, sp, FRAMESZ |
538 |
+ |
539 |
+ # PrepareAndDispatch(that, methodIndex, args) |
540 |
+ jalr t9 |
541 |
+ |
542 |
+ # Micro-optimization: Using jalr explicitly has the side-effect |
543 |
+ # of not triggering .cprestore. This is ok because we have no |
544 |
+ # gp reference below this point. It also allows better |
545 |
+ # instruction sscheduling. |
546 |
+ # lw gp, GPOFF(fp) |
547 |
+ |
548 |
+ lw ra, RAOFF(sp) |
549 |
+ addiu sp, FRAMESZ |
550 |
+ j ra |
551 |
+ END(dummy) |
552 |
diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_mips.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_mips.cpp |
553 |
index 4d60f7b..bdce59c 100644 |
554 |
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_mips.cpp |
555 |
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_mips.cpp |
556 |
@@ -39,6 +39,7 @@ |
557 |
* ***** END LICENSE BLOCK ***** */ |
558 |
|
559 |
#include "xptcprivate.h" |
560 |
+#include "xptiprivate.h" |
561 |
|
562 |
/* |
563 |
* This is for MIPS O32 ABI |
564 |
@@ -54,7 +55,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, PRUint32 methodIndex, PRUint32* args) |
565 |
|
566 |
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT]; |
567 |
nsXPTCMiniVariant* dispatchParams = NULL; |
568 |
- nsIInterfaceInfo* iface_info = NULL; |
569 |
const nsXPTMethodInfo* info; |
570 |
PRUint8 paramCount; |
571 |
PRUint8 i; |
572 |
@@ -62,11 +62,8 @@ PrepareAndDispatch(nsXPTCStubBase* self, PRUint32 methodIndex, PRUint32* args) |
573 |
|
574 |
NS_ASSERTION(self,"no self"); |
575 |
|
576 |
- self->GetInterfaceInfo(&iface_info); |
577 |
- NS_ASSERTION(iface_info,"no interface info"); |
578 |
- |
579 |
- iface_info->GetMethodInfo(PRUint16(methodIndex), &info); |
580 |
- NS_ASSERTION(info,"no interface info"); |
581 |
+ self->mEntry->GetMethodInfo(PRUint16(methodIndex), &info); |
582 |
+ NS_ASSERTION(info,"no method info"); |
583 |
|
584 |
paramCount = info->GetParamCount(); |
585 |
|
586 |
@@ -109,9 +106,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, PRUint32 methodIndex, PRUint32* args) |
587 |
} |
588 |
} |
589 |
|
590 |
- result = self->CallMethod((PRUint16)methodIndex, info, dispatchParams); |
591 |
- |
592 |
- NS_RELEASE(iface_info); |
593 |
+ result = self->mOuter->CallMethod((PRUint16)methodIndex, info, dispatchParams); |
594 |
|
595 |
if(dispatchParams != paramBuffer) |
596 |
delete [] dispatchParams; |
597 |
|
598 |
|
599 |
|
600 |
1.1 src/patchsets/mozilla-firefox/3.0.1/021_noxul-mips-fpic.patch |
601 |
|
602 |
file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/mozilla-firefox/3.0.1/021_noxul-mips-fpic.patch?rev=1.1&view=markup |
603 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/mozilla-firefox/3.0.1/021_noxul-mips-fpic.patch?rev=1.1&content-type=text/plain |
604 |
|
605 |
Index: 021_noxul-mips-fpic.patch |
606 |
=================================================================== |
607 |
Upstream bug: https://bugzilla.mozilla.org/attachment.cgi?id=321598 |
608 |
|
609 |
We've had an issue on debian with the mips xpcom stubs because gcc 4.3 changed |
610 |
its default from PIC to non-PIC. While the whole c++ code is built as PIC code, |
611 |
the xptc stubs assembly ends up built as non-PIC. |
612 |
|
613 |
It would be safer to build the assembly with -fPIC when C++ is built with -fPIC, |
614 |
to avoid future possible problems with gcc changing its default again on |
615 |
some random architecture. The attached patch does it for linux, but it might be |
616 |
necessary to do the same on other architectures. |
617 |
|
618 |
Patch $Revision: 1.1 $ |
619 |
diff --git a/configure.in b/configure.in |
620 |
index 3730f0e..516da66 100644 |
621 |
--- a/configure.in |
622 |
+++ b/configure.in |
623 |
@@ -1279,6 +1279,7 @@ if test "$GNU_CC"; then |
624 |
WARNINGS_AS_ERRORS='-Werror' |
625 |
DSO_CFLAGS='' |
626 |
DSO_PIC_CFLAGS='-fPIC' |
627 |
+ ASFLAGS="$ASFLAGS -fPIC" |
628 |
_MOZ_RTTI_FLAGS_ON=${_COMPILER_PREFIX}-frtti |
629 |
_MOZ_RTTI_FLAGS_OFF=${_COMPILER_PREFIX}-fno-rtti |
630 |
_MOZ_EXCEPTIONS_FLAGS_ON='-fhandle-exceptions' |
631 |
|
632 |
|
633 |
|
634 |
1.1 src/patchsets/mozilla-firefox/3.0.1/030-firefox_encode_spaces.patch |
635 |
|
636 |
file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/mozilla-firefox/3.0.1/030-firefox_encode_spaces.patch?rev=1.1&view=markup |
637 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/mozilla-firefox/3.0.1/030-firefox_encode_spaces.patch?rev=1.1&content-type=text/plain |
638 |
|
639 |
Index: 030-firefox_encode_spaces.patch |
640 |
=================================================================== |
641 |
# Upstream bug 440075 |
642 |
diff --git a/browser/base/content/urlbarBindings.xml b/browser/base/content/urlbarBindings.xml |
643 |
--- a/browser/base/content/urlbarBindings.xml |
644 |
+++ b/browser/base/content/urlbarBindings.xml |
645 |
@@ -139,54 +139,55 @@ |
646 |
// haven't seen that, so hopefully that behavior has changed. |
647 |
flavourSet.appendFlavour("text/x-moz-url"); |
648 |
flavourSet.appendFlavour("text/unicode"); |
649 |
flavourSet.appendFlavour("application/x-moz-file", "nsIFile"); |
650 |
return flavourSet; |
651 |
]]></body> |
652 |
</method> |
653 |
|
654 |
+ <method name="_getSelectedValueForClipboard"> |
655 |
+ <body><![CDATA[ |
656 |
+ var val = this.value.substring(this.selectionStart, this.selectionEnd); |
657 |
+ |
658 |
+ // If the entire value is selected and it's a valid non-javascript, |
659 |
+ // non-data URI, encode it. |
660 |
+ if (val == this.value && |
661 |
+ this.getAttribute("pageproxystate") == "valid") { |
662 |
+ let uri; |
663 |
+ let ioService = Cc["@mozilla.org/network/io-service;1"] |
664 |
+ .getService(Ci.nsIIOService); |
665 |
+ try { |
666 |
+ uri = ioService.newURI(val, null, null); |
667 |
+ } catch (e) {} |
668 |
+ if (uri && !uri.schemeIs("javascript") && !uri.schemeIs("data")) |
669 |
+ val = uri.spec; |
670 |
+ } |
671 |
+ |
672 |
+ return val; |
673 |
+ ]]></body> |
674 |
+ </method> |
675 |
+ |
676 |
<field name="_copyCutController"><![CDATA[ |
677 |
({ |
678 |
urlbar: this, |
679 |
doCommand: function(aCommand) { |
680 |
var urlbar = this.urlbar; |
681 |
- var start = urlbar.selectionStart; |
682 |
- var end = urlbar.selectionEnd; |
683 |
- if (start == end) |
684 |
+ var val = urlbar._getSelectedValueForClipboard(); |
685 |
+ if (!val) |
686 |
return; |
687 |
- var val; |
688 |
- if (start == 0 && end == urlbar.textLength) { |
689 |
- val = urlbar.value; |
690 |
|
691 |
- // If the entire value is selected and it's a valid non-javascript, |
692 |
- // non-data URI, encode it. |
693 |
- var uri; |
694 |
- if (urlbar.getAttribute("pageproxystate") == "valid") { |
695 |
- var ioService = Cc["@mozilla.org/network/io-service;1"] |
696 |
- .getService(Ci.nsIIOService); |
697 |
- try { |
698 |
- uri = ioService.newURI(val, null, null); |
699 |
- } catch (e) {} |
700 |
- } |
701 |
- if (uri && !uri.schemeIs("javascript") && !uri.schemeIs("data")) |
702 |
- val = uri.spec; |
703 |
+ if (aCommand == "cmd_cut" && this.isCommandEnabled(aCommand)) { |
704 |
+ let start = urlbar.selectionStart; |
705 |
+ let end = urlbar.selectionEnd; |
706 |
+ urlbar.value = urlbar.value.substring(0, start) + urlbar.value.substring(end); |
707 |
+ urlbar.selectionStart = urlbar.selectionEnd = start; |
708 |
+ SetPageProxyState("invalid"); |
709 |
+ } |
710 |
|
711 |
- if (aCommand == "cmd_cut" && this.isCommandEnabled(aCommand)) { |
712 |
- urlbar.value = ""; |
713 |
- SetPageProxyState("invalid"); |
714 |
- } |
715 |
- } else { |
716 |
- val = urlbar.value.substring(start, end); |
717 |
- if (aCommand == "cmd_cut" && this.isCommandEnabled(aCommand)) { |
718 |
- urlbar.value = urlbar.value.substring(0, start) + urlbar.value.substring(end); |
719 |
- urlbar.selectionStart = urlbar.selectionEnd = start; |
720 |
- SetPageProxyState("invalid"); |
721 |
- } |
722 |
- } |
723 |
Cc["@mozilla.org/widget/clipboardhelper;1"] |
724 |
.getService(Ci.nsIClipboardHelper) |
725 |
.copyString(val); |
726 |
}, |
727 |
supportsCommand: function(aCommand) { |
728 |
switch (aCommand) { |
729 |
case "cmd_copy": |
730 |
case "cmd_cut": |
731 |
@@ -268,16 +269,30 @@ |
732 |
</setter> |
733 |
</property> |
734 |
</implementation> |
735 |
|
736 |
<handlers> |
737 |
<handler event="focus" phase="capturing" action="this._hideURLTooltip();"/> |
738 |
<handler event="dragover" phase="capturing" action="nsDragAndDrop.dragOver(event, this);"/> |
739 |
<handler event="dragdrop" phase="capturing" action="nsDragAndDrop.drop(event, this);"/> |
740 |
+ <handler event="select"><![CDATA[ |
741 |
+ if (!Cc["@mozilla.org/widget/clipboard;1"] |
742 |
+ .getService(Ci.nsIClipboard) |
743 |
+ .supportsSelectionClipboard()) |
744 |
+ return; |
745 |
+ |
746 |
+ var val = this._getSelectedValueForClipboard(); |
747 |
+ if (!val) |
748 |
+ return; |
749 |
+ |
750 |
+ Cc["@mozilla.org/widget/clipboardhelper;1"] |
751 |
+ .getService(Ci.nsIClipboardHelper) |
752 |
+ .copyStringToClipboard(val, Ci.nsIClipboard.kSelectionClipboard); |
753 |
+ ]]></handler> |
754 |
</handlers> |
755 |
|
756 |
</binding> |
757 |
|
758 |
<!-- Note: this binding is applied to the autocomplete popup used in the Search bar and in web page content --> |
759 |
<binding id="browser-autocomplete-result-popup" extends="chrome://global/content/bindings/autocomplete.xml#autocomplete-result-popup"> |
760 |
<implementation> |
761 |
<method name="openAutocompletePopup"> |