зеркало из https://github.com/mozilla/pjs.git
Tweak xptc so that it works on Irix with gcc.
Thanks to John Vandenberg <zeroJ@null.net> for the patches. Bug #79362 r=cls a=asa for 0.9.1
This commit is contained in:
Родитель
3cd44086a1
Коммит
bbc335acd4
|
@ -169,6 +169,9 @@ ifeq ($(OS_ARCH),IRIX)
|
|||
ifneq ($(basename $(OS_RELEASE)),5)
|
||||
CPPSRCS := xptcinvoke_irix.cpp xptcstubs_irix.cpp
|
||||
ASFILES := xptcinvoke_asm_irix.s xptcstubs_asm_irix.s
|
||||
ifdef GNU_CC
|
||||
ASFLAGS += -Wa,-D__GNUC__
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
|
|
|
@ -73,25 +73,40 @@ NESTED(_XPTC_InvokeByIndex, FRAMESZ, ra)
|
|||
REG_L a0, A0OFF(sp) # a0 - that
|
||||
REG_L a1, A1OFF(sp) # a1 - methodIndex
|
||||
|
||||
#ifdef __GNUC__
|
||||
# t1 = methodIndex * 8
|
||||
# (use shift instead of mult)
|
||||
sll t1, a1, 3
|
||||
#else
|
||||
# t1 = methodIndex * 12
|
||||
# (use shift and subtract trick instead of mult)
|
||||
sll t1, a1, 2
|
||||
subu t1, t1, a1
|
||||
sll t1, t1, 2
|
||||
#endif
|
||||
|
||||
# calculate the function we need to jump to,
|
||||
# which must then be saved in t9
|
||||
lw t9, 0(a0)
|
||||
addu t9, t9, t1
|
||||
#ifdef __GNUC__
|
||||
lw t9, 12(t9) # t9 = *(that+t1+12)
|
||||
#else
|
||||
li t2, 20
|
||||
addu t9, t9, t2
|
||||
lw t9, 0(t9) # t9 = *(that+t1+20)
|
||||
#endif
|
||||
|
||||
# calculate the proper "this" pointer for the
|
||||
# function that they asked for
|
||||
lw t0, 0(a0)
|
||||
addu t0, t1
|
||||
#ifdef __GNUC__
|
||||
lh t0, 8(t0)
|
||||
#else
|
||||
lw t0, 12(t0)
|
||||
#endif
|
||||
|
||||
addu a0, a0, t0
|
||||
|
||||
# get register save area from invoke_copy_to_stack
|
||||
|
|
|
@ -28,7 +28,11 @@ F19OFF=FRAMESZ-(10*SZREG)
|
|||
|
||||
#define SENTINEL_ENTRY(nn) /* defined in cpp file, not here */
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define STUB_ENTRY(nn) MAKE_STUB(nn, Stub/**/nn/**/__14nsXPTCStubBase)
|
||||
#else
|
||||
#define STUB_ENTRY(nn) MAKE_STUB(nn, Stub/**/nn/**/__14nsXPTCStubBaseGv)
|
||||
#endif
|
||||
|
||||
#define MAKE_STUB(nn, name) \
|
||||
NESTED(name, FRAMESZ, ra); \
|
||||
|
|
Загрузка…
Ссылка в новой задаче