v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
v8::internal::LazyCompileDispatcher Class Reference

#include <lazy-compile-dispatcher.h>

Collaboration diagram for v8::internal::LazyCompileDispatcher:

Classes

struct  Job
 
class  JobTask
 

Public Types

using JobId = uintptr_t
 

Public Member Functions

 LazyCompileDispatcher (Isolate *isolate, Platform *platform, size_t max_stack_size)
 
 LazyCompileDispatcher (const LazyCompileDispatcher &)=delete
 
LazyCompileDispatcheroperator= (const LazyCompileDispatcher &)=delete
 
 ~LazyCompileDispatcher ()
 
void Enqueue (LocalIsolate *isolate, Handle< SharedFunctionInfo > shared_info, std::unique_ptr< Utf16CharacterStream > character_stream)
 
bool IsEnqueued (DirectHandle< SharedFunctionInfo > function) const
 
bool FinishNow (DirectHandle< SharedFunctionInfo > function)
 
void AbortJob (DirectHandle< SharedFunctionInfo > function)
 
void AbortAll ()
 

Private Types

using SharedToJobMap = IdentityMap<Job*, FreeStoreAllocationPolicy>
 

Private Member Functions

 FRIEND_TEST (LazyCompileDispatcherTest, IdleTaskNoIdleTime)
 
 FRIEND_TEST (LazyCompileDispatcherTest, IdleTaskSmallIdleTime)
 
 FRIEND_TEST (LazyCompileDispatcherTest, FinishNowWithWorkerTask)
 
 FRIEND_TEST (LazyCompileDispatcherTest, AbortJobNotStarted)
 
 FRIEND_TEST (LazyCompileDispatcherTest, AbortJobAlreadyStarted)
 
 FRIEND_TEST (LazyCompileDispatcherTest, AsyncAbortAllPendingWorkerTask)
 
 FRIEND_TEST (LazyCompileDispatcherTest, AsyncAbortAllRunningWorkerTask)
 
 FRIEND_TEST (LazyCompileDispatcherTest, CompileMultipleOnBackgroundThread)
 
void WaitForJobIfRunningOnBackground (Job *job, const base::MutexGuard &)
 
JobGetJobFor (DirectHandle< SharedFunctionInfo > shared, const base::MutexGuard &) const
 
JobPopSingleFinalizeJob ()
 
void ScheduleIdleTaskFromAnyThread (const base::MutexGuard &)
 
bool FinalizeSingleJob ()
 
void DoBackgroundWork (JobDelegate *delegate)
 
void DoIdleWork (double deadline_in_seconds)
 
void DeleteJob (Job *job)
 
void DeleteJob (Job *job, const base::MutexGuard &)
 
void NotifyAddedBackgroundJob (const base::MutexGuard &lock)
 
void NotifyRemovedBackgroundJob (const base::MutexGuard &lock)
 
void VerifyBackgroundTaskCount (const base::MutexGuard &)
 

Private Attributes

Isolateisolate_
 
WorkerThreadRuntimeCallStatsworker_thread_runtime_call_stats_
 
TimedHistogrambackground_compile_timer_
 
std::shared_ptr< TaskRunnertaskrunner_
 
Platformplatform_
 
size_t max_stack_size_
 
std::unique_ptr< JobHandlejob_handle_
 
bool trace_compiler_dispatcher_
 
std::unique_ptr< CancelableTaskManageridle_task_manager_
 
base::Mutex mutex_
 
bool idle_task_scheduled_
 
std::vector< Job * > pending_background_jobs_
 
std::vector< Job * > finalizable_jobs_
 
std::atomic< size_tnum_jobs_for_background_
 
std::vector< Job * > jobs_to_dispose_
 
Jobmain_thread_blocking_on_job_
 
base::ConditionVariable main_thread_blocking_signal_
 
base::AtomicValue< boolblock_for_testing_
 
base::Semaphore semaphore_for_testing_
 

Detailed Description

Definition at line 75 of file lazy-compile-dispatcher.h.

Member Typedef Documentation

◆ JobId

Definition at line 77 of file lazy-compile-dispatcher.h.

◆ SharedToJobMap

Constructor & Destructor Documentation

◆ LazyCompileDispatcher() [1/2]

v8::internal::LazyCompileDispatcher::LazyCompileDispatcher ( Isolate * isolate,
Platform * platform,
size_t max_stack_size )

Definition at line 60 of file lazy-compile-dispatcher.cc.

Here is the call graph for this function:

◆ LazyCompileDispatcher() [2/2]

v8::internal::LazyCompileDispatcher::LazyCompileDispatcher ( const LazyCompileDispatcher & )
delete

◆ ~LazyCompileDispatcher()

v8::internal::LazyCompileDispatcher::~LazyCompileDispatcher ( )

Definition at line 83 of file lazy-compile-dispatcher.cc.

Member Function Documentation

◆ AbortAll()

void v8::internal::LazyCompileDispatcher::AbortAll ( )

Definition at line 349 of file lazy-compile-dispatcher.cc.

Here is the call graph for this function:

◆ AbortJob()

void v8::internal::LazyCompileDispatcher::AbortJob ( DirectHandle< SharedFunctionInfo > function)

Definition at line 305 of file lazy-compile-dispatcher.cc.

Here is the call graph for this function:

◆ DeleteJob() [1/2]

void v8::internal::LazyCompileDispatcher::DeleteJob ( Job * job)
private

Definition at line 549 of file lazy-compile-dispatcher.cc.

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

◆ DeleteJob() [2/2]

void v8::internal::LazyCompileDispatcher::DeleteJob ( Job * job,
const base::MutexGuard &  )
private

Definition at line 555 of file lazy-compile-dispatcher.cc.

◆ DoBackgroundWork()

void v8::internal::LazyCompileDispatcher::DoBackgroundWork ( JobDelegate * delegate)
private

Definition at line 407 of file lazy-compile-dispatcher.cc.

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

◆ DoIdleWork()

void v8::internal::LazyCompileDispatcher::DoIdleWork ( double deadline_in_seconds)
private

Definition at line 523 of file lazy-compile-dispatcher.cc.

Here is the call graph for this function:

◆ Enqueue()

void v8::internal::LazyCompileDispatcher::Enqueue ( LocalIsolate * isolate,
Handle< SharedFunctionInfo > shared_info,
std::unique_ptr< Utf16CharacterStream > character_stream )

Definition at line 150 of file lazy-compile-dispatcher.cc.

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

◆ FinalizeSingleJob()

bool v8::internal::LazyCompileDispatcher::FinalizeSingleJob ( )
private

Definition at line 502 of file lazy-compile-dispatcher.cc.

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

◆ FinishNow()

bool v8::internal::LazyCompileDispatcher::FinishNow ( DirectHandle< SharedFunctionInfo > function)

Definition at line 253 of file lazy-compile-dispatcher.cc.

Here is the call graph for this function:

◆ FRIEND_TEST() [1/8]

v8::internal::LazyCompileDispatcher::FRIEND_TEST ( LazyCompileDispatcherTest ,
AbortJobAlreadyStarted  )
private

◆ FRIEND_TEST() [2/8]

v8::internal::LazyCompileDispatcher::FRIEND_TEST ( LazyCompileDispatcherTest ,
AbortJobNotStarted  )
private

◆ FRIEND_TEST() [3/8]

v8::internal::LazyCompileDispatcher::FRIEND_TEST ( LazyCompileDispatcherTest ,
AsyncAbortAllPendingWorkerTask  )
private

◆ FRIEND_TEST() [4/8]

v8::internal::LazyCompileDispatcher::FRIEND_TEST ( LazyCompileDispatcherTest ,
AsyncAbortAllRunningWorkerTask  )
private

◆ FRIEND_TEST() [5/8]

v8::internal::LazyCompileDispatcher::FRIEND_TEST ( LazyCompileDispatcherTest ,
CompileMultipleOnBackgroundThread  )
private

◆ FRIEND_TEST() [6/8]

v8::internal::LazyCompileDispatcher::FRIEND_TEST ( LazyCompileDispatcherTest ,
FinishNowWithWorkerTask  )
private

◆ FRIEND_TEST() [7/8]

v8::internal::LazyCompileDispatcher::FRIEND_TEST ( LazyCompileDispatcherTest ,
IdleTaskNoIdleTime  )
private

◆ FRIEND_TEST() [8/8]

v8::internal::LazyCompileDispatcher::FRIEND_TEST ( LazyCompileDispatcherTest ,
IdleTaskSmallIdleTime  )
private

◆ GetJobFor()

LazyCompileDispatcher::Job * v8::internal::LazyCompileDispatcher::GetJobFor ( DirectHandle< SharedFunctionInfo > shared,
const base::MutexGuard &  ) const
private

Definition at line 380 of file lazy-compile-dispatcher.cc.

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

◆ IsEnqueued()

bool v8::internal::LazyCompileDispatcher::IsEnqueued ( DirectHandle< SharedFunctionInfo > function) const

Definition at line 185 of file lazy-compile-dispatcher.cc.

Here is the call graph for this function:

◆ NotifyAddedBackgroundJob()

void v8::internal::LazyCompileDispatcher::NotifyAddedBackgroundJob ( const base::MutexGuard & lock)
inlineprivate

Definition at line 168 of file lazy-compile-dispatcher.h.

Here is the caller graph for this function:

◆ NotifyRemovedBackgroundJob()

void v8::internal::LazyCompileDispatcher::NotifyRemovedBackgroundJob ( const base::MutexGuard & lock)
inlineprivate

Definition at line 172 of file lazy-compile-dispatcher.h.

Here is the caller graph for this function:

◆ operator=()

LazyCompileDispatcher & v8::internal::LazyCompileDispatcher::operator= ( const LazyCompileDispatcher & )
delete

◆ PopSingleFinalizeJob()

LazyCompileDispatcher::Job * v8::internal::LazyCompileDispatcher::PopSingleFinalizeJob ( )
private

Definition at line 484 of file lazy-compile-dispatcher.cc.

Here is the caller graph for this function:

◆ ScheduleIdleTaskFromAnyThread()

void v8::internal::LazyCompileDispatcher::ScheduleIdleTaskFromAnyThread ( const base::MutexGuard & )
private

Definition at line 394 of file lazy-compile-dispatcher.cc.

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

◆ VerifyBackgroundTaskCount()

void v8::internal::LazyCompileDispatcher::VerifyBackgroundTaskCount ( const base::MutexGuard & )
inlineprivate

Definition at line 180 of file lazy-compile-dispatcher.h.

Here is the caller graph for this function:

◆ WaitForJobIfRunningOnBackground()

void v8::internal::LazyCompileDispatcher::WaitForJobIfRunningOnBackground ( Job * job,
const base::MutexGuard & lock )
private

Definition at line 200 of file lazy-compile-dispatcher.cc.

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

Member Data Documentation

◆ background_compile_timer_

TimedHistogram* v8::internal::LazyCompileDispatcher::background_compile_timer_
private

Definition at line 185 of file lazy-compile-dispatcher.h.

◆ block_for_testing_

base::AtomicValue<bool> v8::internal::LazyCompileDispatcher::block_for_testing_
private

Definition at line 233 of file lazy-compile-dispatcher.h.

◆ finalizable_jobs_

std::vector<Job*> v8::internal::LazyCompileDispatcher::finalizable_jobs_
private

Definition at line 209 of file lazy-compile-dispatcher.h.

◆ idle_task_manager_

std::unique_ptr<CancelableTaskManager> v8::internal::LazyCompileDispatcher::idle_task_manager_
private

Definition at line 196 of file lazy-compile-dispatcher.h.

◆ idle_task_scheduled_

bool v8::internal::LazyCompileDispatcher::idle_task_scheduled_
private

Definition at line 203 of file lazy-compile-dispatcher.h.

◆ isolate_

Isolate* v8::internal::LazyCompileDispatcher::isolate_
private

Definition at line 183 of file lazy-compile-dispatcher.h.

◆ job_handle_

std::unique_ptr<JobHandle> v8::internal::LazyCompileDispatcher::job_handle_
private

Definition at line 190 of file lazy-compile-dispatcher.h.

◆ jobs_to_dispose_

std::vector<Job*> v8::internal::LazyCompileDispatcher::jobs_to_dispose_
private

Definition at line 225 of file lazy-compile-dispatcher.h.

◆ main_thread_blocking_on_job_

Job* v8::internal::LazyCompileDispatcher::main_thread_blocking_on_job_
private

Definition at line 229 of file lazy-compile-dispatcher.h.

◆ main_thread_blocking_signal_

base::ConditionVariable v8::internal::LazyCompileDispatcher::main_thread_blocking_signal_
private

Definition at line 230 of file lazy-compile-dispatcher.h.

◆ max_stack_size_

size_t v8::internal::LazyCompileDispatcher::max_stack_size_
private

Definition at line 188 of file lazy-compile-dispatcher.h.

◆ mutex_

base::Mutex v8::internal::LazyCompileDispatcher::mutex_
mutableprivate

Definition at line 200 of file lazy-compile-dispatcher.h.

◆ num_jobs_for_background_

std::atomic<size_t> v8::internal::LazyCompileDispatcher::num_jobs_for_background_
private

Definition at line 213 of file lazy-compile-dispatcher.h.

◆ pending_background_jobs_

std::vector<Job*> v8::internal::LazyCompileDispatcher::pending_background_jobs_
private

Definition at line 206 of file lazy-compile-dispatcher.h.

◆ platform_

Platform* v8::internal::LazyCompileDispatcher::platform_
private

Definition at line 187 of file lazy-compile-dispatcher.h.

◆ semaphore_for_testing_

base::Semaphore v8::internal::LazyCompileDispatcher::semaphore_for_testing_
private

Definition at line 234 of file lazy-compile-dispatcher.h.

◆ taskrunner_

std::shared_ptr<TaskRunner> v8::internal::LazyCompileDispatcher::taskrunner_
private

Definition at line 186 of file lazy-compile-dispatcher.h.

◆ trace_compiler_dispatcher_

bool v8::internal::LazyCompileDispatcher::trace_compiler_dispatcher_
private

Definition at line 194 of file lazy-compile-dispatcher.h.

◆ worker_thread_runtime_call_stats_

WorkerThreadRuntimeCallStats* v8::internal::LazyCompileDispatcher::worker_thread_runtime_call_stats_
private

Definition at line 184 of file lazy-compile-dispatcher.h.


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