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

Unified Diff: src/platform-linux.cc

Issue 13704002: Minor Native Client specific changes to files in src. (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Cleaner disabling of profiling. Created 7 years, 8 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/ia32/cpu-ia32.cc ('k') | src/platform-posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform-linux.cc
diff --git a/src/platform-linux.cc b/src/platform-linux.cc
index 1f9cde151c13f554a108a4b90b74573187808cdd..d10e4df591431ce9f54ca90c8162acd87aae4684 100644
--- a/src/platform-linux.cc
+++ b/src/platform-linux.cc
@@ -428,6 +428,8 @@ void OS::DebugBreak() {
# endif
#elif defined(__mips__)
asm("break");
+#elif defined(__native_client__)
+ asm("hlt");
#else
asm("int $3");
#endif
@@ -822,12 +824,16 @@ void Thread::set_name(const char* name) {
void Thread::Start() {
pthread_attr_t* attr_ptr = NULL;
+#if defined(__native_client__)
+ // use default stack size.
+#else
pthread_attr_t attr;
if (stack_size_ > 0) {
pthread_attr_init(&attr);
pthread_attr_setstacksize(&attr, static_cast<size_t>(stack_size_));
attr_ptr = &attr;
}
+#endif
int result = pthread_create(&data_->thread_, attr_ptr, ThreadEntry, this);
CHECK_EQ(0, result);
ASSERT(data_->thread_ != kNoThread);
@@ -1074,6 +1080,11 @@ static int GetThreadID() {
static void ProfilerSignalHandler(int signal, siginfo_t* info, void* context) {
+#if defined(__native_client__)
+ // As Native Client does not support signal handling, profiling
+ // is disabled.
+ return;
+#else
USE(info);
if (signal != SIGPROF) return;
Isolate* isolate = Isolate::UncheckedCurrent();
@@ -1126,6 +1137,7 @@ static void ProfilerSignalHandler(int signal, siginfo_t* info, void* context) {
#endif // V8_HOST_ARCH_*
sampler->SampleStack(sample);
sampler->Tick(sample);
+#endif // __native_client__
}
« no previous file with comments | « src/ia32/cpu-ia32.cc ('k') | src/platform-posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698