Bug 1365515 (part 1) - Remove profiler support for x86/Darwin. r=mstange.
☠☠ backed out by e61af009b471 ☠ ☠
authorNicholas Nethercote <nnethercote@mozilla.com>
Wed, 17 May 2017 17:28:59 +1000
changeset 359245 7ba879bb0961978845bc2c4d30043e44ee0200ae
parent 359244 9aa66595bf51a1cec03f61b88bfecac09742157b
child 359246 368f63c34bad52d96902b2e8c87b0bfea33d5dfd
push id31850
push userryanvm@gmail.com
push dateFri, 19 May 2017 15:47:16 +0000
treeherdermozilla-central@c800b6dfca67 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1365515
milestone55.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
Bug 1365515 (part 1) - Remove profiler support for x86/Darwin. r=mstange. It's now either tier 3 or unsupported, I'm not sure which.
tools/profiler/core/PlatformMacros.h
tools/profiler/core/platform-macos.cpp
--- a/tools/profiler/core/PlatformMacros.h
+++ b/tools/profiler/core/PlatformMacros.h
@@ -13,17 +13,16 @@
 //
 // Note: "GP" is short for "Gecko Profiler".
 
 #undef GP_PLAT_x86_android
 #undef GP_PLAT_arm_android
 #undef GP_PLAT_aarch64_android
 #undef GP_PLAT_x86_linux
 #undef GP_PLAT_amd64_linux
-#undef GP_PLAT_x86_darwin
 #undef GP_PLAT_amd64_darwin
 #undef GP_PLAT_x86_windows
 #undef GP_PLAT_amd64_windows
 
 #undef GP_ARCH_x86
 #undef GP_ARCH_amd64
 #undef GP_ARCH_arm
 #undef GP_ARCH_aarch64
@@ -56,21 +55,16 @@
 # define GP_ARCH_x86 1
 # define GP_OS_linux 1
 
 #elif defined(__linux__) && defined(__x86_64__)
 # define GP_PLAT_amd64_linux 1
 # define GP_ARCH_amd64 1
 # define GP_OS_linux 1
 
-#elif defined(__APPLE__) && defined(__i386__)
-# define GP_PLAT_x86_darwin 1
-# define GP_ARCH_x86 1
-# define GP_OS_darwin 1
-
 #elif defined(__APPLE__) && defined(__x86_64__)
 # define GP_PLAT_amd64_darwin 1
 # define GP_ARCH_amd64 1
 # define GP_OS_darwin 1
 
 #elif (defined(_MSC_VER) || defined(__MINGW32__)) && \
       (defined(_M_IX86) || defined(__i386__))
 # define GP_PLAT_x86_windows 1
--- a/tools/profiler/core/platform-macos.cpp
+++ b/tools/profiler/core/platform-macos.cpp
@@ -97,40 +97,25 @@ Sampler::SuspendAndSampleAndResumeThread
   // Sample the target thread.
 
   // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
   //
   // The profiler's "critical section" begins here.  We must be very careful
   // what we do here, or risk deadlock.  See the corresponding comment in
   // platform-linux-android.cpp for details.
 
-#if defined(GP_ARCH_amd64)
   thread_state_flavor_t flavor = x86_THREAD_STATE64;
   x86_thread_state64_t state;
   mach_msg_type_number_t count = x86_THREAD_STATE64_COUNT;
 # if __DARWIN_UNIX03
 #  define REGISTER_FIELD(name) __r ## name
 # else
 #  define REGISTER_FIELD(name) r ## name
 # endif  // __DARWIN_UNIX03
 
-#elif defined(GP_ARCH_x86)
-  thread_state_flavor_t flavor = i386_THREAD_STATE;
-  i386_thread_state_t state;
-  mach_msg_type_number_t count = i386_THREAD_STATE_COUNT;
-# if __DARWIN_UNIX03
-#  define REGISTER_FIELD(name) __e ## name
-# else
-#  define REGISTER_FIELD(name) e ## name
-# endif  // __DARWIN_UNIX03
-
-#else
-# error Unsupported Mac OS X host architecture.
-#endif  // GP_ARCH_*
-
   if (thread_get_state(samplee_thread,
                        flavor,
                        reinterpret_cast<natural_t*>(&state),
                        &count) == KERN_SUCCESS) {
     aSample.mPC = reinterpret_cast<Address>(state.REGISTER_FIELD(ip));
     aSample.mSP = reinterpret_cast<Address>(state.REGISTER_FIELD(sp));
     aSample.mFP = reinterpret_cast<Address>(state.REGISTER_FIELD(bp));
 
@@ -210,39 +195,22 @@ PlatformInit(PSLockRef aLock)
 }
 
 void
 TickSample::PopulateContext(void* aContext)
 {
   MOZ_ASSERT(mIsSynchronous);
   MOZ_ASSERT(!aContext);
 
-  // Note that this asm changes if PopulateContext's parameter list is altered
-#if defined(GP_ARCH_amd64)
   asm (
       // Compute caller's %rsp by adding to %rbp:
       // 8 bytes for previous %rbp, 8 bytes for return address
       "leaq 0x10(%%rbp), %0\n\t"
       // Dereference %rbp to get previous %rbp
       "movq (%%rbp), %1\n\t"
       :
       "=r"(mSP),
       "=r"(mFP)
   );
-#elif defined(GP_ARCH_x86)
-  asm (
-      // Compute caller's %esp by adding to %ebp:
-      // 4 bytes for aContext + 4 bytes for return address +
-      // 4 bytes for previous %ebp
-      "leal 0xc(%%ebp), %0\n\t"
-      // Dereference %ebp to get previous %ebp
-      "movl (%%ebp), %1\n\t"
-      :
-      "=r"(mSP),
-      "=r"(mFP)
-  );
-#else
-# error "Unsupported architecture"
-#endif
   mPC = reinterpret_cast<Address>(__builtin_extract_return_addr(
                                     __builtin_return_address(0)));
 }