Revert e4c69005dea6 to see if OS X Bm goes green.
authorRafael Ávila de Espíndola <respindola@mozilla.com>
Wed, 07 Sep 2011 18:20:55 -0400
changeset 78008 487fce479fe823d065cebd47aab313031ff45517
parent 78007 487d32a1e29af2ce92580d616f48065d1b02ea9e
child 78009 6e321c2f2a075f97f5f84ef4d9e3bbf96bcd20f5
push id78
push userclegnitto@mozilla.com
push dateFri, 16 Dec 2011 17:32:24 +0000
treeherdermozilla-release@79d24e644fdd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone9.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Revert e4c69005dea6 to see if OS X Bm goes green.
xpcom/reflect/xptcall/src/md/unix/Makefile.in
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_unixish_x86.cpp
--- a/xpcom/reflect/xptcall/src/md/unix/Makefile.in
+++ b/xpcom/reflect/xptcall/src/md/unix/Makefile.in
@@ -60,16 +60,32 @@ FORCE_USE_PIC	= 1
 ifeq ($(OS_ARCH),SunOS)
 ifneq (86,$(findstring 86,$(OS_TEST)))
 # disable PGO for this directory with Sun Studio on SPARC because
 # compiling with xprofile=collect will insert code into nsXPTCStubBase::Stub##n
 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
 
 ######################################################################
 # i386 and beyond
 ######################################################################
 #
 # Lots of Unixish x86 flavors
 #
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_unixish_x86.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_unixish_x86.cpp
@@ -73,17 +73,16 @@ invoke_copy_to_stack(PRUint32 paramCount
 
 }
 
 EXPORT_XPCOM_API(nsresult)
 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
      amount takes time. */
   PRUint32 n = paramCount << 3;
   void (*fn_copy) (unsigned int, nsXPTCVariant *, PRUint32 *) = invoke_copy_to_stack;
   int temp1, temp2;
  
@@ -161,18 +160,17 @@ NS_InvokeByIndex_P(nsISupports* that, PR
       "=d" (temp2),         /* %2 */
 #ifdef KEEP_STACK_16_BYTE_ALIGNED
       "=&g" (saved_esp)     /* %3 */
 #else
       /* Don't waste a register, this isn't used if alignment is unimportant */
       "=m" (saved_esp)      /* %3 */
 #endif
     : "g" (that),           /* %4 */
-      /* Must be in a register since we modify esp in the assembly. */
-      "r" (methodIndexReg), /* %5 */
+      "g" (methodIndex),    /* %5 */
       "1" (paramCount),     /* %6 */
       "2" (params),         /* %7 */
 #ifdef KEEP_STACK_16_BYTE_ALIGNED
       /* Must be in a register, it's the target of an LEA instruction */
       "r" (n),              /* %8 */
 #else
       "g" (n),              /* %8 */
 #endif