зеркало из https://github.com/mozilla/pjs.git
Fix crashes on ia64 Linux when a method with more than 7 arguments is called
through XPCOM. Bug 291378, patch by David Mosberger <davidm@hpl.hp.com>, r+sr+a=shaver
This commit is contained in:
Родитель
cd2a02f3fc
Коммит
6dea09d616
|
@ -44,7 +44,7 @@ for($i = 0; $i < $entry_count; $i++) {
|
|||
}
|
||||
print OUTFILE "#else\n";
|
||||
for($i = 0; $i < $entry_count; $i++) {
|
||||
print OUTFILE "NS_IMETHOD Stub",$i+3,"(PRUint64,\n";
|
||||
print OUTFILE "NS_IMETHOD Stub",$i+3,"(PRUint64,PRUint64,\n";
|
||||
print OUTFILE " PRUint64,PRUint64,PRUint64,PRUint64,PRUint64,PRUint64);\n";
|
||||
|
||||
}
|
||||
|
|
|
@ -15,15 +15,17 @@
|
|||
.type PrepareAndDispatch,@function
|
||||
|
||||
SharedStub::
|
||||
// 9 arguments, first 8 are the input arguments of previous
|
||||
// function call. The last one is methodIndex, and is passed in memory
|
||||
// 10 arguments, first 8 are the input arguments of previous
|
||||
// function call. The 9th one is methodIndex and the 10th is the
|
||||
// pointer to the remaining input arguments. The last two arguments
|
||||
// are passed in memory.
|
||||
.prologue
|
||||
.save ar.pfs , r41
|
||||
// allocate 8 input args, 4 local args, and 5 output args
|
||||
alloc r41 = ar.pfs, 8, 4, 5, 0 // M
|
||||
.save rp, r40
|
||||
mov r40 = rp // I
|
||||
nop.i 0 ;; // I
|
||||
addp4 out4 = 28, sp ;; // I
|
||||
|
||||
.save ar.unat, r42
|
||||
mov r42 = ar.unat // M
|
||||
|
@ -46,12 +48,9 @@ SharedStub::
|
|||
.body
|
||||
add out0 = 0, in0 // A move self ptr
|
||||
// 144 bytes = 16 byte stack header + 64 byte int space + 64 byte float space
|
||||
// current frame is 144 bytes, previous frame is 112 bytes
|
||||
// restarg is at 144 + 112 + 16 bytes away from current sp
|
||||
// (current frame + previous frame + previous previous frame header)
|
||||
// methodIndex is at 144 + 16 bytes away from current sp
|
||||
// (current frame + previous frame header)
|
||||
add out4 = 192, sp // A restarg address
|
||||
ld4 out4 = [out4] // A restarg address
|
||||
add r11 = 160, sp ;; // A address of methodIndex
|
||||
|
||||
ld8 out1 = [r11] // M load methodIndex
|
||||
|
|
|
@ -15,15 +15,17 @@
|
|||
.type PrepareAndDispatch,@function
|
||||
|
||||
SharedStub::
|
||||
// 9 arguments, first 8 are the input arguments of previous
|
||||
// function call. The last one is methodIndex, and is passed in memory
|
||||
// 10 arguments, first 8 are the input arguments of previous
|
||||
// function call. The 9th one is methodIndex and the 10th is the
|
||||
// pointer to the remaining input arguments. The last two arguments
|
||||
// are passed in memory.
|
||||
.prologue
|
||||
.save ar.pfs , r41
|
||||
// allocate 8 input args, 4 local args, and 5 output args
|
||||
alloc r41 = ar.pfs, 8, 4, 5, 0 // M
|
||||
.save rp, r40
|
||||
mov r40 = rp // I
|
||||
nop.i 0 ;; // I
|
||||
add out4 = 24, sp ;; // I
|
||||
|
||||
.save ar.unat, r42
|
||||
mov r42 = ar.unat // M
|
||||
|
@ -46,12 +48,9 @@ SharedStub::
|
|||
.body
|
||||
add out0 = 0, in0 // A move self ptr
|
||||
// 144 bytes = 16 byte stack header + 64 byte int space + 64 byte float space
|
||||
// current frame is 144 bytes, previous frame is 112 bytes
|
||||
// restarg is at 144 + 112 + 16 bytes away from current sp
|
||||
// (current frame + previous frame + previous previous frame header)
|
||||
// methodIndex is at 144 + 16 bytes away from current sp
|
||||
// (current frame + previous frame header)
|
||||
add out4 = 192, sp // A restarg address
|
||||
ld8 out4 = [out4] // M restarg address
|
||||
add r11 = 160, sp ;; // A address of methodIndex
|
||||
|
||||
ld8 out1 = [r11] // M load methodIndex
|
||||
|
|
|
@ -162,16 +162,17 @@ PrepareAndDispatch(nsXPTCStubBase* self, PRUint32 methodIndex,
|
|||
}
|
||||
|
||||
extern "C" int SharedStub(PRUint64,PRUint64,PRUint64,PRUint64,
|
||||
PRUint64,PRUint64,PRUint64,PRUint64,PRUint64);
|
||||
PRUint64,PRUint64,PRUint64,PRUint64,PRUint64,PRUint64 *);
|
||||
|
||||
/* Variable a0-a7 were put there so we can have access to the 8 input
|
||||
registers on Stubxyz entry */
|
||||
|
||||
#define STUB_ENTRY(n) \
|
||||
nsresult nsXPTCStubBase::Stub##n(PRUint64 a1, \
|
||||
PRUint64 a2,PRUint64 a3,PRUint64 a4,PRUint64 a5,PRUint64 a6,PRUint64 a7) \
|
||||
PRUint64 a2,PRUint64 a3,PRUint64 a4,PRUint64 a5,PRUint64 a6,PRUint64 a7, \
|
||||
PRUint64 a8) \
|
||||
{ uint64_t a0 = (uint64_t) this; \
|
||||
return SharedStub(a0,a1,a2,a3,a4,a5,a6,a7,(PRUint64) n); \
|
||||
return SharedStub(a0,a1,a2,a3,a4,a5,a6,a7,(PRUint64) n, &a8); \
|
||||
}
|
||||
|
||||
#define SENTINEL_ENTRY(n) \
|
||||
|
|
|
@ -163,16 +163,17 @@ PrepareAndDispatch(nsXPTCStubBase* self, PRUint32 methodIndex,
|
|||
}
|
||||
|
||||
extern "C" int SharedStub(PRUint64,PRUint64,PRUint64,PRUint64,
|
||||
PRUint64,PRUint64,PRUint64,PRUint64,PRUint64);
|
||||
PRUint64,PRUint64,PRUint64,PRUint64,PRUint64,PRUint64 *);
|
||||
|
||||
/* Variable a0-a7 were put there so we can have access to the 8 input
|
||||
registers on Stubxyz entry */
|
||||
|
||||
#define STUB_ENTRY(n) \
|
||||
nsresult nsXPTCStubBase::Stub##n(PRUint64 a1, \
|
||||
PRUint64 a2,PRUint64 a3,PRUint64 a4,PRUint64 a5,PRUint64 a6,PRUint64 a7) \
|
||||
PRUint64 a2,PRUint64 a3,PRUint64 a4,PRUint64 a5,PRUint64 a6,PRUint64 a7, \
|
||||
PRUint64 a8) \
|
||||
{ uint64_t a0 = (uint64_t) this; \
|
||||
return SharedStub(a0,a1,a2,a3,a4,a5,a6,a7,(PRUint64) n); \
|
||||
return SharedStub(a0,a1,a2,a3,a4,a5,a6,a7,(PRUint64) n, &a8); \
|
||||
}
|
||||
|
||||
#define SENTINEL_ENTRY(n) \
|
||||
|
|
Загрузка…
Ссылка в новой задаче