Index: src/platform-solaris.cc |
diff --git a/src/platform-solaris.cc b/src/platform-solaris.cc |
index 3c4df665f0cfe2748191fc83e8f511e95d61bfd4..b1d88af2939de69b8a4fc31a18786318a24af346 100644 |
--- a/src/platform-solaris.cc |
+++ b/src/platform-solaris.cc |
@@ -81,35 +81,9 @@ namespace v8 { |
namespace internal { |
-// 0 is never a valid thread id on Solaris since the main thread is 1 and |
-// subsequent have their ids incremented from there |
-static const pthread_t kNoThread = (pthread_t) 0; |
- |
- |
-double ceiling(double x) { |
- return ceil(x); |
-} |
- |
- |
static Mutex* limit_mutex = NULL; |
-void OS::PostSetUp() { |
- POSIXPostSetUp(); |
-} |
- |
- |
-uint64_t OS::CpuFeaturesImpliedByPlatform() { |
- return 0; // Solaris runs on a lot of things. |
-} |
- |
- |
-int OS::ActivationFrameAlignment() { |
- // GCC generates code that requires 16 byte alignment such as movdqa. |
- return Max(STACK_ALIGN, 16); |
-} |
- |
- |
const char* OS::LocalTimezone(double time) { |
if (std::isnan(time)) return ""; |
time_t tv = static_cast<time_t>(floor(time/msPerSecond)); |
@@ -150,11 +124,6 @@ bool OS::IsOutsideAllocatedSpace(void* address) { |
} |
-size_t OS::AllocateAlignment() { |
- return static_cast<size_t>(getpagesize()); |
-} |
- |
- |
void* OS::Allocate(const size_t requested, |
size_t* allocated, |
bool is_executable) { |
@@ -172,36 +141,6 @@ void* OS::Allocate(const size_t requested, |
} |
-void OS::Free(void* address, const size_t size) { |
- // TODO(1240712): munmap has a return value which is ignored here. |
- int result = munmap(address, size); |
- USE(result); |
- ASSERT(result == 0); |
-} |
- |
- |
-void OS::Sleep(int milliseconds) { |
- useconds_t ms = static_cast<useconds_t>(milliseconds); |
- usleep(1000 * ms); |
-} |
- |
- |
-int OS::NumberOfCores() { |
- return sysconf(_SC_NPROCESSORS_ONLN); |
-} |
- |
- |
-void OS::Abort() { |
- // Redirect to std abort to signal abnormal program termination. |
- abort(); |
-} |
- |
- |
-void OS::DebugBreak() { |
- asm("int $3"); |
-} |
- |
- |
void OS::DumpBacktrace() { |
// Currently unsupported. |
} |
@@ -454,90 +393,6 @@ bool VirtualMemory::HasLazyCommits() { |
} |
-class Thread::PlatformData : public Malloced { |
- public: |
- PlatformData() : thread_(kNoThread) { } |
- |
- pthread_t thread_; // Thread handle for pthread. |
-}; |
- |
- |
-Thread::Thread(const Options& options) |
- : data_(new PlatformData()), |
- stack_size_(options.stack_size()), |
- start_semaphore_(NULL) { |
- set_name(options.name()); |
-} |
- |
- |
-Thread::~Thread() { |
- delete data_; |
-} |
- |
- |
-static void* ThreadEntry(void* arg) { |
- Thread* thread = reinterpret_cast<Thread*>(arg); |
- // This is also initialized by the first argument to pthread_create() but we |
- // don't know which thread will run first (the original thread or the new |
- // one) so we initialize it here too. |
- thread->data()->thread_ = pthread_self(); |
- ASSERT(thread->data()->thread_ != kNoThread); |
- thread->NotifyStartedAndRun(); |
- return NULL; |
-} |
- |
- |
-void Thread::set_name(const char* name) { |
- strncpy(name_, name, sizeof(name_)); |
- name_[sizeof(name_) - 1] = '\0'; |
-} |
- |
- |
-void Thread::Start() { |
- pthread_attr_t attr; |
- if (stack_size_ > 0) { |
- pthread_attr_init(&attr); |
- pthread_attr_setstacksize(&attr, static_cast<size_t>(stack_size_)); |
- } |
- pthread_create(&data_->thread_, NULL, ThreadEntry, this); |
- ASSERT(data_->thread_ != kNoThread); |
-} |
- |
- |
-void Thread::Join() { |
- pthread_join(data_->thread_, NULL); |
-} |
- |
- |
-Thread::LocalStorageKey Thread::CreateThreadLocalKey() { |
- pthread_key_t key; |
- int result = pthread_key_create(&key, NULL); |
- USE(result); |
- ASSERT(result == 0); |
- return static_cast<LocalStorageKey>(key); |
-} |
- |
- |
-void Thread::DeleteThreadLocalKey(LocalStorageKey key) { |
- pthread_key_t pthread_key = static_cast<pthread_key_t>(key); |
- int result = pthread_key_delete(pthread_key); |
- USE(result); |
- ASSERT(result == 0); |
-} |
- |
- |
-void* Thread::GetThreadLocal(LocalStorageKey key) { |
- pthread_key_t pthread_key = static_cast<pthread_key_t>(key); |
- return pthread_getspecific(pthread_key); |
-} |
- |
- |
-void Thread::SetThreadLocal(LocalStorageKey key, void* value) { |
- pthread_key_t pthread_key = static_cast<pthread_key_t>(key); |
- pthread_setspecific(pthread_key, value); |
-} |
- |
- |
class SolarisSemaphore : public Semaphore { |
public: |
explicit SolarisSemaphore(int count) { sem_init(&sem_, 0, count); } |