From ac8eb91185065e975b70dd3bb2e9fcb01de5316b Mon Sep 17 00:00:00 2001 From: "svenpanne@chromium.org" Date: Wed, 27 Aug 2014 13:47:19 +0000 Subject: [PATCH] Some PNaCL compatibility fixes. * Removed a few useless and non-standard #includes. * Made OS::GetCurrentProcessId compile without syscall. R=bmeurer@chromium.org Review URL: https://codereview.chromium.org/508933002 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23459 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/base/platform/platform-posix.cc | 21 +++++++++++++-------- src/heap/mark-compact-inl.h | 2 -- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/base/platform/platform-posix.cc b/src/base/platform/platform-posix.cc index ee5b72e..ea06ff5 100644 --- a/src/base/platform/platform-posix.cc +++ b/src/base/platform/platform-posix.cc @@ -6,7 +6,6 @@ // own, but contains the parts which are the same across the POSIX platforms // Linux, MacOS, FreeBSD, OpenBSD, NetBSD and QNX. -#include #include #include #include @@ -20,10 +19,12 @@ #include #include #include +#if !defined(__pnacl__) #include +#endif #include #include -#if defined(__linux__) +#if defined(__linux__) && !defined(__pnacl__) #include // NOLINT, for prctl #endif #if defined(__APPLE__) || defined(__DragonFly__) || defined(__FreeBSD__) || \ @@ -31,10 +32,6 @@ #include // NOLINT, for sysctl #endif -#include -#include -#include - #undef MAP_TYPE #if defined(ANDROID) && !defined(V8_ANDROID_LOG_STDOUT) @@ -55,6 +52,10 @@ #include "src/base/atomicops.h" #endif +#if V8_OS_MACOSX +#include +#endif + namespace v8 { namespace base { @@ -252,9 +253,13 @@ int OS::GetCurrentProcessId() { int OS::GetCurrentThreadId() { #if defined(ANDROID) return static_cast(syscall(__NR_gettid)); -#else +#elif defined(SYS_gettid) return static_cast(syscall(SYS_gettid)); -#endif // defined(ANDROID) +#else + // PNaCL doesn't have a way to get an integral thread ID, but it doesn't + // really matter, because we only need it in PerfJitLogger::LogRecordedBuffer. + return 0; +#endif } diff --git a/src/heap/mark-compact-inl.h b/src/heap/mark-compact-inl.h index 742ffea..66b0a59 100644 --- a/src/heap/mark-compact-inl.h +++ b/src/heap/mark-compact-inl.h @@ -5,8 +5,6 @@ #ifndef V8_HEAP_MARK_COMPACT_INL_H_ #define V8_HEAP_MARK_COMPACT_INL_H_ -#include - #include "src/heap/mark-compact.h" #include "src/isolate.h" -- 2.7.4