Bug 1233666 - Remove hacks for getting frame pointer for x86/x64 gcc. r=glandium, a=sylvestre
authorXidorn Quan <quanxunzhen@gmail.com>
Tue, 22 Dec 2015 20:24:33 +1100
changeset 310504 7187a3cdb795973f3b9cb4deaf667407314f7c0d
parent 310503 3f93f9d49477032fd076d7e3532113cc3c593178
child 310505 1a3d2912e28e28b5d372a959b4bae03df63cb625
push id5513
push userraliiev@mozilla.com
push dateMon, 25 Jan 2016 13:55:34 +0000
treeherdermozilla-beta@5ee97dd05b5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium, sylvestre
bugs1233666
milestone45.0a2
Bug 1233666 - Remove hacks for getting frame pointer for x86/x64 gcc. r=glandium, a=sylvestre
mozglue/misc/StackWalk.cpp
--- a/mozglue/misc/StackWalk.cpp
+++ b/mozglue/misc/StackWalk.cpp
@@ -891,25 +891,17 @@ MozStackWalk(MozWalkStackCallback aCallb
              uint32_t aMaxFrames, void* aClosure, uintptr_t aThread,
              void* aPlatformData)
 {
   MOZ_ASSERT(!aThread);
   MOZ_ASSERT(!aPlatformData);
   StackWalkInitCriticalAddress();
 
   // Get the frame pointer
-  void** bp;
-#if defined(__i386)
-  __asm__("movl %%ebp, %0" : "=g"(bp));
-#else
-  // It would be nice if this worked uniformly, but at least on i386 and
-  // x86_64, it stopped working with gcc 4.1, because it points to the
-  // end of the saved registers instead of the start.
-  bp = (void**)__builtin_frame_address(0);
-#endif
+  void** bp = (void**)__builtin_frame_address(0);
 
   void* stackEnd;
 #if HAVE___LIBC_STACK_END
   stackEnd = __libc_stack_end;
 #else
   stackEnd = reinterpret_cast<void*>(-1);
 #endif
   return FramePointerStackWalk(aCallback, aSkipFrames, aMaxFrames,