V8 Project
|
#include <platform.h>
Classes | |
class | Options |
class | PlatformData |
Public Types | |
typedef int32_t | LocalStorageKey |
Public Member Functions | |
Thread (const Options &options) | |
virtual | ~Thread () |
void | Start () |
void | StartSynchronously () |
void | Join () |
const char * | name () const |
virtual void | Run ()=0 |
PlatformData * | data () |
void | NotifyStartedAndRun () |
Static Public Member Functions | |
static LocalStorageKey | CreateThreadLocalKey () |
static void | DeleteThreadLocalKey (LocalStorageKey key) |
static void * | GetThreadLocal (LocalStorageKey key) |
static int | GetThreadLocalInt (LocalStorageKey key) |
static void | SetThreadLocal (LocalStorageKey key, void *value) |
static void | SetThreadLocalInt (LocalStorageKey key, int value) |
static bool | HasThreadLocal (LocalStorageKey key) |
static void * | GetExistingThreadLocal (LocalStorageKey key) |
static void | YieldCPU () |
Static Public Attributes | |
static const int | kMaxThreadNameLength = 16 |
Private Member Functions | |
void | set_name (const char *name) |
DISALLOW_COPY_AND_ASSIGN (Thread) | |
Private Attributes | |
PlatformData * | data_ |
char | name_ [kMaxThreadNameLength] |
int | stack_size_ |
Semaphore * | start_semaphore_ |
Definition at line 413 of file platform.h.
typedef int32_t v8::base::Thread::LocalStorageKey |
Definition at line 416 of file platform.h.
|
explicit |
Definition at line 455 of file platform-posix.cc.
References v8::base::Thread::Options::name(), set_name(), and stack_size_.
|
virtual |
|
static |
Definition at line 635 of file platform-posix.cc.
References DCHECK_EQ, NULL, v8::base::PthreadKeyToLocalKey(), and USE().
Referenced by v8::internal::anonymous_namespace{assert-scope.cc}::FINAL::Construct(), v8::internal::Isolate::InitializeOncePerProcess(), and v8::base::anonymous_namespace{platform-unittest.cc}::ThreadLocalStorageTest::ThreadLocalStorageTest().
|
inline |
Definition at line 495 of file platform.h.
References data_.
Referenced by v8::base::ThreadEntry().
|
static |
Definition at line 656 of file platform-posix.cc.
References DCHECK_EQ, v8::base::LocalKeyToPthreadKey(), and USE().
Referenced by v8::base::anonymous_namespace{platform-unittest.cc}::ThreadLocalStorageTest::~ThreadLocalStorageTest().
|
private |
|
inlinestatic |
Definition at line 481 of file platform.h.
References GetThreadLocal().
Referenced by v8::internal::Isolate::INLINE(), and v8::base::anonymous_namespace{platform-unittest.cc}::ThreadLocalStorageTest::Run().
|
static |
Definition at line 664 of file platform-posix.cc.
References v8::base::LocalKeyToPthreadKey().
Referenced by v8::internal::Isolate::CurrentPerIsolateThreadData(), v8::internal::FINAL< kOperandKind, kNumCachedOperands >::GetCurrent(), GetExistingThreadLocal(), GetThreadLocalInt(), HasThreadLocal(), v8::internal::Isolate::INLINE(), and v8::base::anonymous_namespace{platform-unittest.cc}::ThreadLocalStorageTest::Run().
|
inlinestatic |
Definition at line 462 of file platform.h.
References GetThreadLocal().
Referenced by v8::internal::ThreadId::GetCurrentThreadId().
|
inlinestatic |
Definition at line 469 of file platform.h.
References GetThreadLocal(), and NULL.
Referenced by v8::base::anonymous_namespace{platform-unittest.cc}::ThreadLocalStorageTest::Run().
void v8::base::Thread::Join | ( | ) |
Definition at line 542 of file platform-posix.cc.
References data_, NULL, and v8::base::Thread::PlatformData::thread_.
Referenced by v8::internal::Profiler::Disengage(), v8::internal::SamplerThread::RemoveActiveSampler(), v8::internal::SweeperThread::Stop(), v8::internal::OptimizingCompilerThread::Stop(), v8::internal::ProfilerEventsProcessor::StopSynchronously(), v8::base::TEST(), and v8::platform::WorkerThread::~WorkerThread().
|
inline |
Definition at line 451 of file platform.h.
References name_.
Referenced by set_name(), and v8::base::ThreadEntry().
|
inline |
Definition at line 497 of file platform.h.
References Run(), and start_semaphore_.
Referenced by v8::base::ThreadEntry().
|
pure virtual |
Implemented in v8::platform::WorkerThread, v8::platform::anonymous_namespace{task-queue-unittest.cc}::FINAL, v8::base::anonymous_namespace{semaphore-unittest.cc}::FINAL, v8::base::anonymous_namespace{semaphore-unittest.cc}::FINAL, v8::base::anonymous_namespace{semaphore-unittest.cc}::FINAL, v8::base::anonymous_namespace{platform-unittest.cc}::FINAL, v8::base::anonymous_namespace{condition-variable-unittest.cc}::FINAL, v8::base::anonymous_namespace{condition-variable-unittest.cc}::FINAL, v8::base::anonymous_namespace{condition-variable-unittest.cc}::FINAL, v8::base::anonymous_namespace{platform-unittest.cc}::ThreadLocalStorageTest, v8::internal::SamplerThread, v8::internal::OptimizingCompilerThread, v8::internal::Profiler, v8::internal::SweeperThread, v8::SourceGroup::IsolateThread, and v8::internal::ProfilerEventsProcessor.
Referenced by NotifyStartedAndRun().
|
private |
Definition at line 511 of file platform-posix.cc.
Referenced by Thread().
|
static |
Definition at line 670 of file platform-posix.cc.
References DCHECK_EQ, v8::base::LocalKeyToPthreadKey(), and USE().
Referenced by v8::base::anonymous_namespace{platform-unittest.cc}::ThreadLocalStorageTest::Run(), v8::internal::FINAL< kOperandKind, kNumCachedOperands >::SetCurrent(), v8::internal::Isolate::SetIsolateThreadLocals(), and SetThreadLocalInt().
|
inlinestatic |
Definition at line 466 of file platform.h.
References SetThreadLocal().
Referenced by v8::internal::ThreadId::GetCurrentThreadId().
void v8::base::Thread::Start | ( | ) |
Definition at line 517 of file platform-posix.cc.
References data_, DCHECK, DCHECK_EQ, v8::base::kNoThread, stack_size_, v8::base::Thread::PlatformData::thread_, v8::base::Thread::PlatformData::thread_creation_mutex_, v8::base::ThreadEntry(), and USE().
Referenced by v8::internal::Profiler::Engage(), v8::internal::Isolate::Init(), StartSynchronously(), v8::base::TEST(), and v8::platform::WorkerThread::WorkerThread().
|
inline |
Definition at line 440 of file platform.h.
References NULL, Start(), and start_semaphore_.
Referenced by v8::internal::SamplerThread::AddActiveSampler(), and v8::internal::CpuProfiler::StartProcessorIfNotStarted().
|
static |
|
private |
|
static |
Definition at line 492 of file platform.h.
Referenced by v8::base::SetThreadName().
|
private |
Definition at line 507 of file platform.h.
Referenced by name(), and set_name().
|
private |
Definition at line 508 of file platform.h.
|
private |
Definition at line 509 of file platform.h.
Referenced by NotifyStartedAndRun(), and StartSynchronously().