Bugzilla Bug 295306.

Firefox is unusable in solaris x86 using Sun SOS10 compiler.
Patch maker, leon.sha@sun.com.
darin: review+
darin: superreview+
asa: approval1.8b3+
This commit is contained in:
leon.sha%sun.com 2005-06-15 08:32:23 +00:00
parent 4beb182da2
commit 3690bcd936
3 changed files with 98 additions and 18 deletions

View File

@ -111,7 +111,7 @@ ifeq ($(OS_TEST),i86pc)
CPPSRCS := xptcinvoke_x86_solaris.cpp xptcstubs_x86_solaris.cpp
# 28817: if Solaris Intel OS, and native compiler, always build optimised.
ifndef GNU_CC
ASFILES := xptcinvoke_asm_x86_solaris_SUNW.s
ASFILES := xptcinvoke_asm_x86_solaris_SUNW.s xptcstubs_asm_x86_solaris_SUNW.s
CXXFLAGS += -O
endif
endif
@ -417,3 +417,17 @@ xptcstubs_asm_openvms_alpha.o: $(PUBLIC)/xptcstubsdef.inc $(srcdir)/xptcstubs_as
@rm -f ./xptcstubsdef_asm.vms
endif
ifeq ($(OS_ARCH),SunOS)
ifeq ($(OS_TEST),i86pc)
ifndef GNU_CC
xptcstubs_asm_x86_solaris_SUNW.o: $(PUBLIC)/xptcstubsdef.inc $(srcdir)/xptcstubs_asm_x86_solaris_SUNW.s
sed \
-e 's/^\(STUB_ENTRY\)(\([0-9]\))/\11\(\2\)/' \
-e 's/^\(STUB_ENTRY\)(\([0-9][0-9]\))/\12\(\2\)/' \
-e 's/^\(STUB_ENTRY\)(\([0-9][0-9][0-9]\))/\13\(\2\)/' \
$(PUBLIC)/xptcstubsdef.inc > ./xptcstubsdef_asm.solx86
$(AS) -o $@ $(ASFLAGS) $(AS_DASH_C_FLAG) $(srcdir)/xptcstubs_asm_x86_solaris_SUNW.s
@rm -f ./xptcstubsdef_asm.solx86
endif
endif
endif

View File

@ -0,0 +1,78 @@
#define STUB_ENTRY1(nn) \
.globl __1cOnsXPTCStubBaseFStub/**/nn/**/6M_I_; \
.type __1cOnsXPTCStubBaseFStub/**/nn/**/6M_I_, @function; \
__1cOnsXPTCStubBaseFStub/**/nn/**/6M_I_: \
push %ebp; \
movl %esp,%ebp; \
andl $-16,%esp; \
push %ebx; \
call .CG4./**/nn/**/; \
.CG4./**/nn/**/: \
pop %ebx; \
addl $_GLOBAL_OFFSET_TABLE_+0x1,%ebx; \
leal 0xc(%ebp), %ecx; \
pushl %ecx; \
pushl $/**/nn/**/; \
movl 0x8(%ebp), %ecx; \
pushl %ecx; \
call __1cSPrepareAndDispatch6FpnOnsXPTCStubBase_IpI_I_; \
addl $0xc , %esp; \
pop %ebx; \
movl %ebp,%esp; \
pop %ebp; \
ret ; \
.size __1cOnsXPTCStubBaseFStub/**/nn/**/6M_I_, . - __1cOnsXPTCStubBaseFStub/**/nn/**/6M_I_ \
#define STUB_ENTRY2(nn) \
.globl __1cOnsXPTCStubBaseGStub/**/nn/**/6M_I_; \
.type __1cOnsXPTCStubBaseGStub/**/nn/**/6M_I_, @function; \
__1cOnsXPTCStubBaseGStub/**/nn/**/6M_I_: \
push %ebp; \
movl %esp,%ebp; \
andl $-16,%esp; \
push %ebx; \
call .CG4./**/nn/**/; \
.CG4./**/nn/**/: \
pop %ebx; \
addl $_GLOBAL_OFFSET_TABLE_+0x1,%ebx; \
leal 0xc(%ebp), %ecx; \
pushl %ecx; \
pushl $/**/nn/**/; \
movl 0x8(%ebp), %ecx; \
pushl %ecx; \
call __1cSPrepareAndDispatch6FpnOnsXPTCStubBase_IpI_I_; \
addl $0xc , %esp; \
pop %ebx; \
movl %ebp,%esp; \
pop %ebp; \
ret ; \
.size __1cOnsXPTCStubBaseGStub/**/nn/**/6M_I_, . - __1cOnsXPTCStubBaseGStub/**/nn/**/6M_I_ \
#define STUB_ENTRY3(nn) \
.globl __1cOnsXPTCStubBaseHStub/**/nn/**/6M_I_; \
.type __1cOnsXPTCStubBaseHStub/**/nn/**/6M_I_, @function; \
__1cOnsXPTCStubBaseHStub/**/nn/**/6M_I_: \
push %ebp; \
movl %esp,%ebp; \
andl $-16,%esp; \
push %ebx; \
call .CG4./**/nn/**/; \
.CG4./**/nn/**/: \
pop %ebx; \
addl $_GLOBAL_OFFSET_TABLE_+0x1,%ebx; \
leal 0xc(%ebp), %ecx; \
pushl %ecx; \
pushl $/**/nn/**/; \
movl 0x8(%ebp), %ecx; \
pushl %ecx; \
call __1cSPrepareAndDispatch6FpnOnsXPTCStubBase_IpI_I_; \
addl $0xc , %esp; \
pop %ebx; \
movl %ebp,%esp; \
pop %ebp; \
ret ; \
.size __1cOnsXPTCStubBaseHStub/**/nn/**/6M_I_, . - __1cOnsXPTCStubBaseHStub/**/nn/**/6M_I_ \
#define SENTINEL_ENTRY(nn)
#include "xptcstubsdef_asm.solx86"

View File

@ -41,7 +41,10 @@
#include "xptcprivate.h"
#include "xptc_platforms_unixish_x86.h"
static nsresult
#if !defined(__SUNPRO_CC) /* Sun Workshop Compiler. */
static
#endif
nsresult
PrepareAndDispatch(nsXPTCStubBase* self, uint32 methodIndex, PRUint32* args)
{
#define PARAM_BUFFER_COUNT 16
@ -128,22 +131,7 @@ nsresult nsXPTCStubBase::Stub##n() \
#elif defined(__SUNPRO_CC) /* Sun Workshop Compiler. */
#define STUB_ENTRY(n) \
nsresult nsXPTCStubBase::Stub##n() \
{ \
asm ( \
"\n\t leal 0x0c(%ebp), %ecx\t / args" \
"\n\t pushl %ecx" \
"\n\t pushl $"#n"\t / method index" \
"\n\t movl 0x08(%ebp), %ecx\t / this" \
"\n\t pushl %ecx" \
"\n\t call __1cSPrepareAndDispatch6FpnOnsXPTCStubBase_IpI_I_\t / PrepareAndDispatch" \
"\n\t addl $12, %esp" \
); \
/* result == %eax */ \
if(0) /* supress "*** is expected to return a value." error */ \
return 0; \
}
#define STUB_ENTRY(n)
#else
#error "can't find a compiler to use"