V8 Project
v8::internal::ThreadState Class Reference

#include <v8threads.h>

+ Collaboration diagram for v8::internal::ThreadState:

Public Types

enum  List { FREE_LIST , IN_USE_LIST }
 

Public Member Functions

ThreadStateNext ()
 
void LinkInto (List list)
 
void Unlink ()
 
void set_id (ThreadId id)
 
ThreadId id ()
 
bool terminate_on_restore ()
 
void set_terminate_on_restore (bool terminate_on_restore)
 
char * data ()
 

Private Member Functions

 ThreadState (ThreadManager *thread_manager)
 
 ~ThreadState ()
 
void AllocateSpace ()
 

Private Attributes

ThreadId id_
 
bool terminate_on_restore_
 
char * data_
 
ThreadStatenext_
 
ThreadStateprevious_
 
ThreadManagerthread_manager_
 

Friends

class ThreadManager
 

Detailed Description

Definition at line 12 of file v8threads.h.

Member Enumeration Documentation

◆ List

Enumerator
FREE_LIST 
IN_USE_LIST 

Definition at line 17 of file v8threads.h.

Constructor & Destructor Documentation

◆ ThreadState()

v8::internal::ThreadState::ThreadState ( ThreadManager thread_manager)
explicitprivate

Definition at line 182 of file v8threads.cc.

183  : id_(ThreadId::Invalid()),
184  terminate_on_restore_(false),
185  data_(NULL),
186  next_(this),
187  previous_(this),
188  thread_manager_(thread_manager) {
189 }
static ThreadId Invalid()
Definition: isolate.h:188
ThreadState * previous_
Definition: v8threads.h:45
ThreadState * next_
Definition: v8threads.h:44
ThreadManager * thread_manager_
Definition: v8threads.h:47
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be NULL

◆ ~ThreadState()

v8::internal::ThreadState::~ThreadState ( )
private

Definition at line 192 of file v8threads.cc.

192  {
193  DeleteArray<char>(data_);
194 }

References data_.

Member Function Documentation

◆ AllocateSpace()

void v8::internal::ThreadState::AllocateSpace ( )
private

Definition at line 197 of file v8threads.cc.

197  {
198  data_ = NewArray<char>(ArchiveSpacePerThread());
199 }
static int ArchiveSpacePerThread()
Definition: v8threads.cc:171

References v8::internal::ArchiveSpacePerThread(), and data_.

Referenced by v8::internal::ThreadManager::GetFreeThreadState().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ data()

char* v8::internal::ThreadState::data ( )
inline

Definition at line 33 of file v8threads.h.

33 { return data_; }

References data_.

Referenced by v8::internal::ThreadManager::EagerlyArchiveThread(), and v8::internal::ThreadManager::RestoreThread().

+ Here is the caller graph for this function:

◆ id()

ThreadId v8::internal::ThreadState::id ( )
inline

Definition at line 24 of file v8threads.h.

24 { return id_; }

References id_.

Referenced by v8::internal::ThreadManager::ArchiveThread(), v8::internal::RUNTIME_FUNCTION(), and set_id().

+ Here is the caller graph for this function:

◆ LinkInto()

void v8::internal::ThreadState::LinkInto ( List  list)

Definition at line 208 of file v8threads.cc.

208  {
209  ThreadState* flying_anchor =
212  next_ = flying_anchor->next_;
213  previous_ = flying_anchor;
214  flying_anchor->next_ = this;
215  next_->previous_ = this;
216 }
ThreadState * in_use_anchor_
Definition: v8threads.h:110
ThreadState * free_anchor_
Definition: v8threads.h:108
ThreadState(ThreadManager *thread_manager)
Definition: v8threads.cc:182

References v8::internal::ThreadManager::free_anchor_, FREE_LIST, v8::internal::ThreadManager::in_use_anchor_, next_, previous_, and thread_manager_.

Referenced by v8::internal::ThreadManager::EagerlyArchiveThread(), and v8::internal::ThreadManager::RestoreThread().

+ Here is the caller graph for this function:

◆ Next()

ThreadState * v8::internal::ThreadState::Next ( )

Definition at line 236 of file v8threads.cc.

236  {
237  if (next_ == thread_manager_->in_use_anchor_) return NULL;
238  return next_;
239 }

References v8::internal::ThreadManager::in_use_anchor_, next_, NULL, and thread_manager_.

Referenced by v8::internal::ThreadManager::FirstThreadStateInUse(), and v8::internal::RUNTIME_FUNCTION().

+ Here is the caller graph for this function:

◆ set_id()

void v8::internal::ThreadState::set_id ( ThreadId  id)
inline

Definition at line 23 of file v8threads.h.

23 { id_ = id; }

References id(), and id_.

Referenced by v8::internal::ThreadManager::ArchiveThread(), and v8::internal::ThreadManager::RestoreThread().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_terminate_on_restore()

void v8::internal::ThreadState::set_terminate_on_restore ( bool  terminate_on_restore)
inline

Definition at line 28 of file v8threads.h.

References terminate_on_restore(), and terminate_on_restore_.

Referenced by v8::internal::ThreadManager::RestoreThread().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ terminate_on_restore()

bool v8::internal::ThreadState::terminate_on_restore ( )
inline

Definition at line 27 of file v8threads.h.

27 { return terminate_on_restore_; }

References terminate_on_restore_.

Referenced by v8::internal::ThreadManager::RestoreThread(), and set_terminate_on_restore().

+ Here is the caller graph for this function:

◆ Unlink()

void v8::internal::ThreadState::Unlink ( )

Definition at line 202 of file v8threads.cc.

202  {
204  previous_->next_ = next_;
205 }

References next_, and previous_.

Referenced by v8::internal::ThreadManager::ArchiveThread(), and v8::internal::ThreadManager::RestoreThread().

+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ ThreadManager

friend class ThreadManager
friend

Definition at line 49 of file v8threads.h.

Member Data Documentation

◆ data_

char* v8::internal::ThreadState::data_
private

Definition at line 43 of file v8threads.h.

Referenced by AllocateSpace(), data(), and ~ThreadState().

◆ id_

ThreadId v8::internal::ThreadState::id_
private

Definition at line 41 of file v8threads.h.

Referenced by id(), and set_id().

◆ next_

ThreadState* v8::internal::ThreadState::next_
private

◆ previous_

ThreadState* v8::internal::ThreadState::previous_
private

Definition at line 45 of file v8threads.h.

Referenced by LinkInto(), and Unlink().

◆ terminate_on_restore_

bool v8::internal::ThreadState::terminate_on_restore_
private

Definition at line 42 of file v8threads.h.

Referenced by set_terminate_on_restore(), and terminate_on_restore().

◆ thread_manager_

ThreadManager* v8::internal::ThreadState::thread_manager_
private

Definition at line 47 of file v8threads.h.

Referenced by LinkInto(), and Next().


The documentation for this class was generated from the following files: