Bug 684659 - Fix inline asm so that we can drop a use of -fno-omit-frame-pointer.

This commit is contained in:
Rafael Ávila de Espíndola 2011-09-07 15:33:48 -04:00
parent 48b49c1511
commit 1878bb4b35
2 changed files with 3 additions and 17 deletions

View File

@ -65,22 +65,6 @@ NO_PROFILE_GUIDED_OPTIMIZE = 1
endif
endif
ifeq (Darwin,$(OS_ARCH))
ifeq (86,$(findstring 86,$(OS_TEST)))
ifneq (x86_64,$(OS_TEST))
# If we compile xptcinvoke_unixish_x86.cpp with -fomit-frame-pointer
# we end up crashing on startup. This is because
# "movl %5, %%eax\n\t" /* function index */
# becomes
# mov 0x1c(%esp),%eax
# but we have modified esp.
# NOTE: MOZ_FRAMEPTR_FLAGS must be set before including config.mk
# FIXME: change the file instead of using this hack.
MOZ_FRAMEPTR_FLAGS=-fno-omit-frame-pointer
endif
endif
endif
include $(topsrcdir)/config/config.mk
######################################################################

View File

@ -78,6 +78,7 @@ NS_InvokeByIndex_P(nsISupports* that, PRUint32 methodIndex,
PRUint32 paramCount, nsXPTCVariant* params)
{
#ifdef __GNUC__ /* Gnu compiler. */
PRUint32 methodIndexReg = methodIndex;
PRUint32 result;
/* Each param takes at most 2, 4-byte words
It doesn't matter if we push too many words, and calculating the exact
@ -165,7 +166,8 @@ NS_InvokeByIndex_P(nsISupports* that, PRUint32 methodIndex,
"=m" (saved_esp) /* %3 */
#endif
: "g" (that), /* %4 */
"g" (methodIndex), /* %5 */
/* Must be in a register since we modify esp in the assembly. */
"r" (methodIndexReg), /* %5 */
"1" (paramCount), /* %6 */
"2" (params), /* %7 */
#ifdef KEEP_STACK_16_BYTE_ALIGNED