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

Unified Diff: src/sampler.cc

Issue 521473003: More PNaCL fixes (without GYP/Makefile tweaks) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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/d8-posix.cc ('k') | test/cctest/test-api.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 29fe27fd35866ffe62e26105fadbe728bfdc7666..394efeb7640764870b6f768a9d11a1b879955416 100644
--- a/src/sampler.cc
+++ b/src/sampler.cc
@@ -13,7 +13,7 @@
#include <signal.h>
#include <sys/time.h>
-#if !V8_OS_QNX
+#if !V8_OS_QNX && !V8_OS_NACL
#include <sys/syscall.h> // NOLINT
#endif
@@ -21,8 +21,8 @@
#include <mach/mach.h>
// OpenBSD doesn't have <ucontext.h>. ucontext_t lives in <signal.h>
// and is a typedef for struct sigcontext. There is no uc_mcontext.
-#elif(!V8_OS_ANDROID || defined(__BIONIC_HAVE_UCONTEXT_T)) \
- && !V8_OS_OPENBSD
+#elif(!V8_OS_ANDROID || defined(__BIONIC_HAVE_UCONTEXT_T)) && \
+ !V8_OS_OPENBSD && !V8_OS_NACL
#include <ucontext.h>
#endif
@@ -294,6 +294,7 @@ class SignalHandler : public AllStatic {
private:
static void Install() {
+#if !V8_OS_NACL
struct sigaction sa;
sa.sa_sigaction = &HandleProfilerSignal;
sigemptyset(&sa.sa_mask);
@@ -304,16 +305,21 @@ class SignalHandler : public AllStatic {
#endif
signal_handler_installed_ =
(sigaction(SIGPROF, &sa, &old_signal_handler_) == 0);
+#endif
}
static void Restore() {
+#if !V8_OS_NACL
if (signal_handler_installed_) {
sigaction(SIGPROF, &old_signal_handler_, 0);
signal_handler_installed_ = false;
}
+#endif
}
+#if !V8_OS_NACL
static void HandleProfilerSignal(int signal, siginfo_t* info, void* context);
+#endif
// Protects the process wide state below.
static base::Mutex* mutex_;
static int client_count_;
@@ -328,13 +334,10 @@ struct sigaction SignalHandler::old_signal_handler_;
bool SignalHandler::signal_handler_installed_ = false;
+// As Native Client does not support signal handling, profiling is disabled.
+#if !V8_OS_NACL
void SignalHandler::HandleProfilerSignal(int signal, siginfo_t* info,
void* context) {
-#if V8_OS_NACL
- // As Native Client does not support signal handling, profiling
- // is disabled.
- return;
-#else
USE(info);
if (signal != SIGPROF) return;
Isolate* isolate = Isolate::UnsafeCurrent();
@@ -477,8 +480,8 @@ void SignalHandler::HandleProfilerSignal(int signal, siginfo_t* info,
#endif // V8_OS_QNX
#endif // USE_SIMULATOR
sampler->SampleStack(state);
-#endif // V8_OS_NACL
}
+#endif // V8_OS_NACL
#endif
« no previous file with comments | « src/d8-posix.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698