V8 Project
|
#include <v8threads.h>
Public Member Functions | |
void | Lock () |
void | Unlock () |
void | ArchiveThread () |
bool | RestoreThread () |
void | FreeThreadResources () |
bool | IsArchived () |
void | Iterate (ObjectVisitor *v) |
void | IterateArchivedThreads (ThreadVisitor *v) |
bool | IsLockedByCurrentThread () |
ThreadId | CurrentId () |
void | TerminateExecution (ThreadId thread_id) |
ThreadState * | FirstThreadStateInUse () |
ThreadState * | GetFreeThreadState () |
Private Member Functions | |
ThreadManager () | |
~ThreadManager () | |
void | DeleteThreadStateList (ThreadState *anchor) |
void | EagerlyArchiveThread () |
Private Attributes | |
base::Mutex | mutex_ |
ThreadId | mutex_owner_ |
ThreadId | lazily_archived_thread_ |
ThreadState * | lazily_archived_thread_state_ |
ThreadState * | free_anchor_ |
ThreadState * | in_use_anchor_ |
Isolate * | isolate_ |
Friends | |
class | Isolate |
class | ThreadState |
Definition at line 67 of file v8threads.h.
|
private |
Definition at line 245 of file v8threads.cc.
References free_anchor_, in_use_anchor_, and ThreadState.
|
private |
Definition at line 256 of file v8threads.cc.
References DeleteThreadStateList(), free_anchor_, and in_use_anchor_.
void v8::internal::ThreadManager::ArchiveThread | ( | ) |
Definition at line 273 of file v8threads.cc.
References v8::internal::ThreadId::Current(), CurrentId(), DCHECK, v8::internal::Isolate::FindOrAllocatePerThreadDataForThisThread(), GetFreeThreadState(), v8::internal::ThreadState::id(), v8::internal::ThreadId::Invalid(), IsArchived(), IsLockedByCurrentThread(), isolate_, lazily_archived_thread_, lazily_archived_thread_state_, v8::internal::ThreadState::set_id(), and v8::internal::ThreadState::Unlink().
Referenced by v8::Unlocker::Initialize(), and v8::Locker::~Locker().
ThreadId v8::internal::ThreadManager::CurrentId | ( | ) |
Definition at line 353 of file v8threads.cc.
References v8::internal::ThreadId::Current().
Referenced by ArchiveThread().
|
private |
Definition at line 262 of file v8threads.cc.
References v8::internal::ThreadState::next_.
Referenced by ~ThreadManager().
|
private |
Definition at line 290 of file v8threads.cc.
References v8::internal::Debug::ArchiveDebug(), v8::internal::RegExpStack::ArchiveStack(), v8::internal::HandleScopeImplementer::ArchiveThread(), v8::internal::Isolate::ArchiveThread(), v8::internal::Isolate::bootstrapper(), v8::internal::ThreadState::data(), DCHECK, v8::internal::Isolate::debug(), v8::internal::Isolate::handle_scope_implementer(), v8::internal::ThreadState::IN_USE_LIST, v8::internal::ThreadId::Invalid(), IsLockedByCurrentThread(), isolate_, lazily_archived_thread_, lazily_archived_thread_state_, v8::internal::ThreadState::LinkInto(), NULL, v8::internal::Isolate::regexp_stack(), v8::internal::Isolate::stack_guard(), and to().
Referenced by RestoreThread().
ThreadState * v8::internal::ThreadManager::FirstThreadStateInUse | ( | ) |
Definition at line 231 of file v8threads.cc.
References in_use_anchor_, and v8::internal::ThreadState::Next().
Referenced by v8::internal::Deserializer::Deserialize(), Iterate(), IterateArchivedThreads(), v8::internal::StartupSerializer::SerializeStrongReferences(), and TerminateExecution().
void v8::internal::ThreadManager::FreeThreadResources | ( | ) |
Definition at line 309 of file v8threads.cc.
References v8::internal::Isolate::bootstrapper(), DCHECK, v8::internal::Isolate::debug(), v8::internal::HandleScopeImplementer::FreeThreadResources(), v8::internal::Debug::FreeThreadResources(), v8::internal::Isolate::FreeThreadResources(), v8::internal::RegExpStack::FreeThreadResources(), v8::internal::Isolate::handle_scope_implementer(), v8::internal::Isolate::has_pending_exception(), isolate_, NULL, v8::internal::Isolate::regexp_stack(), v8::internal::Isolate::stack_guard(), and v8::internal::Isolate::try_catch_handler().
Referenced by v8::Locker::~Locker().
ThreadState * v8::internal::ThreadManager::GetFreeThreadState | ( | ) |
Definition at line 219 of file v8threads.cc.
References v8::internal::ThreadState::AllocateSpace(), free_anchor_, v8::internal::ThreadState::next_, and ThreadState.
Referenced by ArchiveThread().
bool v8::internal::ThreadManager::IsArchived | ( | ) |
Definition at line 322 of file v8threads.cc.
References v8::internal::Isolate::FindPerThreadDataForThisThread(), isolate_, and NULL.
Referenced by ArchiveThread().
|
inline |
Definition at line 79 of file v8threads.h.
References v8::internal::ThreadId::Current(), and mutex_owner_.
Referenced by ArchiveThread(), EagerlyArchiveThread(), v8::HandleScope::Initialize(), v8::Unlocker::Initialize(), v8::Locker::Initialize(), v8::Locker::IsLocked(), Lock(), RestoreThread(), v8::Locker::~Locker(), and v8::Unlocker::~Unlocker().
void v8::internal::ThreadManager::Iterate | ( | ObjectVisitor * | v | ) |
Definition at line 329 of file v8threads.cc.
References FirstThreadStateInUse(), isolate_, v8::internal::Isolate::Iterate(), v8::internal::HandleScopeImplementer::Iterate(), and NULL.
Referenced by v8::internal::Heap::IterateStrongRoots().
void v8::internal::ThreadManager::IterateArchivedThreads | ( | ThreadVisitor * | v | ) |
Definition at line 342 of file v8threads.cc.
References v8::internal::HandleScopeImplementer::ArchiveSpacePerThread(), FirstThreadStateInUse(), isolate_, v8::internal::Isolate::IterateThread(), and NULL.
Referenced by v8::internal::LiveEdit::CheckAndDropActivations(), v8::internal::Debug::PrepareForBreakPoints(), and v8::internal::MarkCompactCollector::PrepareForCodeFlushing().
void v8::internal::ThreadManager::Lock | ( | ) |
Definition at line 158 of file v8threads.cc.
References v8::internal::ThreadId::Current(), DCHECK, IsLockedByCurrentThread(), mutex_, and mutex_owner_.
Referenced by v8::Locker::Initialize(), and v8::Unlocker::~Unlocker().
bool v8::internal::ThreadManager::RestoreThread | ( | ) |
Definition at line 103 of file v8threads.cc.
References v8::internal::Isolate::bootstrapper(), v8::internal::ThreadId::Current(), v8::internal::ThreadState::data(), DCHECK, v8::internal::Isolate::debug(), EagerlyArchiveThread(), v8::internal::Isolate::FindPerThreadDataForThisThread(), v8::internal::ThreadState::FREE_LIST, v8::internal::Isolate::handle_scope_implementer(), v8::internal::ThreadId::Invalid(), IsLockedByCurrentThread(), isolate_, lazily_archived_thread_, lazily_archived_thread_state_, v8::internal::ThreadState::LinkInto(), NULL, v8::internal::Isolate::regexp_stack(), v8::internal::Debug::RestoreDebug(), v8::internal::RegExpStack::RestoreStack(), v8::internal::HandleScopeImplementer::RestoreThread(), v8::internal::Isolate::RestoreThread(), v8::internal::ThreadState::set_id(), v8::internal::ThreadState::set_terminate_on_restore(), v8::internal::Isolate::stack_guard(), v8::internal::ThreadState::terminate_on_restore(), and v8::internal::ThreadState::Unlink().
Referenced by v8::Locker::Initialize(), and v8::Unlocker::~Unlocker().
void v8::internal::ThreadManager::TerminateExecution | ( | ThreadId | thread_id | ) |
Definition at line 358 of file v8threads.cc.
References FirstThreadStateInUse(), and NULL.
void v8::internal::ThreadManager::Unlock | ( | ) |
Definition at line 165 of file v8threads.cc.
References v8::internal::ThreadId::Invalid(), mutex_, and mutex_owner_.
Referenced by v8::Unlocker::Initialize(), and v8::Locker::~Locker().
|
friend |
Definition at line 114 of file v8threads.h.
|
friend |
Definition at line 115 of file v8threads.h.
Referenced by GetFreeThreadState(), and ThreadManager().
|
private |
Definition at line 108 of file v8threads.h.
Referenced by GetFreeThreadState(), v8::internal::ThreadState::LinkInto(), ThreadManager(), and ~ThreadManager().
|
private |
Definition at line 110 of file v8threads.h.
Referenced by FirstThreadStateInUse(), v8::internal::ThreadState::LinkInto(), v8::internal::ThreadState::Next(), ThreadManager(), and ~ThreadManager().
|
private |
Definition at line 112 of file v8threads.h.
Referenced by ArchiveThread(), EagerlyArchiveThread(), FreeThreadResources(), IsArchived(), v8::internal::Isolate::Isolate(), Iterate(), IterateArchivedThreads(), and RestoreThread().
|
private |
Definition at line 101 of file v8threads.h.
Referenced by ArchiveThread(), EagerlyArchiveThread(), and RestoreThread().
|
private |
Definition at line 102 of file v8threads.h.
Referenced by ArchiveThread(), EagerlyArchiveThread(), and RestoreThread().
|
private |
Definition at line 99 of file v8threads.h.
|
private |
Definition at line 100 of file v8threads.h.
Referenced by IsLockedByCurrentThread(), Lock(), and Unlock().