Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(562)

Unified Diff: src/sampler.cc

Issue 157503002: A64: Synchronize with r18444. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/runtime-profiler.cc ('k') | src/scanner-character-streams.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/sampler.cc
diff --git a/src/sampler.cc b/src/sampler.cc
index 09b5f48ea245a3df1b0e7ae05b94ad71a4489259..33f46c77016b805ce8030aec6b74d0df12818fe8 100644
--- a/src/sampler.cc
+++ b/src/sampler.cc
@@ -35,7 +35,10 @@
#include <pthread.h>
#include <signal.h>
#include <sys/time.h>
+
+#if !V8_OS_QNX
#include <sys/syscall.h>
+#endif
#if V8_OS_MACOSX
#include <mach/mach.h>
@@ -45,6 +48,7 @@
&& !V8_OS_OPENBSD
#include <ucontext.h>
#endif
+
#include <unistd.h>
// GLibc on ARM defines mcontext_t has a typedef for 'struct sigcontext'.
@@ -293,7 +297,11 @@ class SignalHandler : public AllStatic {
struct sigaction sa;
sa.sa_sigaction = &HandleProfilerSignal;
sigemptyset(&sa.sa_mask);
+#if V8_OS_QNX
+ sa.sa_flags = SA_SIGINFO;
+#else
sa.sa_flags = SA_RESTART | SA_SIGINFO;
+#endif
signal_handler_installed_ =
(sigaction(SIGPROF, &sa, &old_signal_handler_) == 0);
}
@@ -452,7 +460,17 @@ void SignalHandler::HandleProfilerSignal(int signal, siginfo_t* info,
state.pc = reinterpret_cast<Address>(mcontext.gregs[REG_PC]);
state.sp = reinterpret_cast<Address>(mcontext.gregs[REG_SP]);
state.fp = reinterpret_cast<Address>(mcontext.gregs[REG_FP]);
-#endif // V8_OS_SOLARIS
+#elif V8_OS_QNX
+#if V8_HOST_ARCH_IA32
+ state.pc = reinterpret_cast<Address>(mcontext.cpu.eip);
+ state.sp = reinterpret_cast<Address>(mcontext.cpu.esp);
+ state.fp = reinterpret_cast<Address>(mcontext.cpu.ebp);
+#elif V8_HOST_ARCH_ARM
+ state.pc = reinterpret_cast<Address>(mcontext.cpu.gpr[ARM_REG_PC]);
+ 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
#endif // USE_SIMULATOR
sampler->SampleStack(state);
#endif // V8_OS_NACL
« no previous file with comments | « src/runtime-profiler.cc ('k') | src/scanner-character-streams.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698