Chromium Code Reviews

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: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« 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..701843a646d8622ea68db8bb2624cdc8138fe40f 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,10 @@ static int GetThreadID() {
static void ProfilerSignalHandler(int signal, siginfo_t* info, void* context) {
+#if defined(__native_client__) && defined(__x86_64__)
+ // Profiling is disabled for x86_64 Native Client.
ulan 2013/04/08 11:27:10 Is this #ifdef needed because of undefined ucontex
Brad Chen 2013/04/08 16:29:56 No, in this case the problem is more fundamental,
Brad Chen 2013/04/08 16:38:32 It might be possible to get this code to compile u
+ return;
+#else
USE(info);
if (signal != SIGPROF) return;
Isolate* isolate = Isolate::UncheckedCurrent();
@@ -1126,6 +1136,7 @@ static void ProfilerSignalHandler(int signal, siginfo_t* info, void* context) {
#endif // V8_HOST_ARCH_*
sampler->SampleStack(sample);
sampler->Tick(sample);
+#endif // __native_client__ && __x86_64__
}
« 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