Index: src/sampler.cc |
diff --git a/src/sampler.cc b/src/sampler.cc |
index 19c5cacee6bbc6398507fd45e1df2e47e986872e..a7d7f349d69c2009a8a4b6efcb651d46b1e5c4be 100644 |
--- a/src/sampler.cc |
+++ b/src/sampler.cc |
@@ -13,7 +13,7 @@ |
#include <signal.h> |
#include <sys/time.h> |
-#if !V8_OS_QNX && !V8_OS_NACL |
+#if !(V8_OS_QNX || V8_OS_AIX) && !V8_OS_NACL |
Sven Panne
2015/01/27 11:47:06
De Morgan's law, please. :-)
michael_dawson
2015/01/29 00:08:29
Will do
|
#include <sys/syscall.h> // NOLINT |
#endif |
@@ -311,6 +311,10 @@ class SignalHandler : public AllStatic { |
static void Restore() { |
#if !V8_OS_NACL |
if (signal_handler_installed_) { |
+#if V8_OS_AIX |
+ // Ensure delivery of any pending SIGPROF before removing the handler |
Sven Panne
2015/01/27 11:47:06
Hmmm, why is this AIX-specific? Why can't there be
michael_dawson
2015/01/29 00:08:29
We went to validate our explanation of why it was
|
+ base::Thread::YieldCPU(); |
+#endif |
sigaction(SIGPROF, &old_signal_handler_, 0); |
signal_handler_installed_ = false; |
} |
@@ -479,7 +483,11 @@ void SignalHandler::HandleProfilerSignal(int signal, siginfo_t* info, |
state.sp = reinterpret_cast<Address>(mcontext.cpu.gpr[ARM_REG_SP]); |
state.fp = reinterpret_cast<Address>(mcontext.cpu.gpr[ARM_REG_FP]); |
#endif // V8_HOST_ARCH_* |
-#endif // V8_OS_QNX |
+#elif V8_OS_AIX |
+ state.pc = reinterpret_cast<Address>(mcontext.jmp_context.iar); |
+ state.sp = reinterpret_cast<Address>(mcontext.jmp_context.gpr[1]); |
+ state.fp = reinterpret_cast<Address>(mcontext.jmp_context.gpr[31]); |
+#endif // V8_OS_AIX |
#endif // USE_SIMULATOR |
sampler->SampleStack(state); |
} |