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

#include <default-platform.h>

Inheritance diagram for v8::platform::DefaultPlatform:
Collaboration diagram for v8::platform::DefaultPlatform:

Public Types

using TimeFunction = double (*)()
 

Public Member Functions

 DefaultPlatform (int thread_pool_size=0, IdleTaskSupport idle_task_support=IdleTaskSupport::kDisabled, std::unique_ptr< v8::TracingController > tracing_controller={}, PriorityMode priority_mode=PriorityMode::kDontApply)
 
 ~DefaultPlatform () override
 
 DefaultPlatform (const DefaultPlatform &)=delete
 
DefaultPlatformoperator= (const DefaultPlatform &)=delete
 
void EnsureBackgroundTaskRunnerInitialized ()
 
bool PumpMessageLoop (v8::Isolate *isolate, MessageLoopBehavior behavior=MessageLoopBehavior::kDoNotWait)
 
void RunIdleTasks (v8::Isolate *isolate, double idle_time_in_seconds)
 
void SetTracingController (std::unique_ptr< v8::TracingController > tracing_controller)
 
void SetTimeFunctionForTesting (TimeFunction time_function)
 
int NumberOfWorkerThreads () override
 
std::shared_ptr< TaskRunnerGetForegroundTaskRunner (v8::Isolate *isolate, TaskPriority priority) override
 
void PostTaskOnWorkerThreadImpl (TaskPriority priority, std::unique_ptr< Task > task, const SourceLocation &location) override
 
void PostDelayedTaskOnWorkerThreadImpl (TaskPriority priority, std::unique_ptr< Task > task, double delay_in_seconds, const SourceLocation &location) override
 
bool IdleTasksEnabled (Isolate *isolate) override
 
std::unique_ptr< JobHandleCreateJobImpl (TaskPriority priority, std::unique_ptr< JobTask > job_state, const SourceLocation &location) override
 
double MonotonicallyIncreasingTime () override
 
double CurrentClockTimeMillis () override
 
v8::TracingControllerGetTracingController () override
 
StackTracePrinter GetStackTracePrinter () override
 
v8::PageAllocatorGetPageAllocator () override
 
v8::ThreadIsolatedAllocatorGetThreadIsolatedAllocator () override
 
void NotifyIsolateShutdown (Isolate *isolate)
 

Private Member Functions

base::Thread::Priority priority_from_index (int i) const
 
int priority_to_index (TaskPriority priority) const
 
int num_worker_runners () const
 

Private Attributes

base::Mutex lock_
 
const int thread_pool_size_
 
IdleTaskSupport idle_task_support_
 
std::shared_ptr< DefaultWorkerThreadsTaskRunnerworker_threads_task_runners_ [static_cast< int >(TaskPriority::kMaxPriority)+1] = {0}
 
std::map< v8::Isolate *, std::shared_ptr< DefaultForegroundTaskRunner > > foreground_task_runner_map_
 
std::unique_ptr< TracingControllertracing_controller_
 
std::unique_ptr< PageAllocatorpage_allocator_
 
DefaultThreadIsolatedAllocator thread_isolated_allocator_
 
const PriorityMode priority_mode_
 
TimeFunction time_function_for_testing_ = nullptr
 

Detailed Description

Definition at line 28 of file default-platform.h.

Member Typedef Documentation

◆ TimeFunction

Definition at line 52 of file default-platform.h.

Constructor & Destructor Documentation

◆ DefaultPlatform() [1/2]

v8::platform::DefaultPlatform::DefaultPlatform ( int thread_pool_size = 0,
IdleTaskSupport idle_task_support = IdleTaskSupport::kDisabled,
std::unique_ptr< v8::TracingController > tracing_controller = {},
PriorityMode priority_mode = PriorityMode::kDontApply )
explicit

Definition at line 95 of file default-platform.cc.

Here is the call graph for this function:

◆ ~DefaultPlatform()

v8::platform::DefaultPlatform::~DefaultPlatform ( )
override

Definition at line 116 of file default-platform.cc.

Here is the call graph for this function:

◆ DefaultPlatform() [2/2]

v8::platform::DefaultPlatform::DefaultPlatform ( const DefaultPlatform & )
delete

Member Function Documentation

◆ CreateJobImpl()

std::unique_ptr< JobHandle > v8::platform::DefaultPlatform::CreateJobImpl ( TaskPriority priority,
std::unique_ptr< JobTask > job_state,
const SourceLocation & location )
override

Definition at line 245 of file default-platform.cc.

Here is the call graph for this function:

◆ CurrentClockTimeMillis()

double v8::platform::DefaultPlatform::CurrentClockTimeMillis ( )
override

Definition at line 261 of file default-platform.cc.

Here is the call graph for this function:

◆ EnsureBackgroundTaskRunnerInitialized()

void v8::platform::DefaultPlatform::EnsureBackgroundTaskRunnerInitialized ( )

Definition at line 137 of file default-platform.cc.

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

◆ GetForegroundTaskRunner()

std::shared_ptr< TaskRunner > v8::platform::DefaultPlatform::GetForegroundTaskRunner ( v8::Isolate * isolate,
TaskPriority priority )
override

Definition at line 200 of file default-platform.cc.

◆ GetPageAllocator()

v8::PageAllocator * v8::platform::DefaultPlatform::GetPageAllocator ( )
override

Definition at line 281 of file default-platform.cc.

◆ GetStackTracePrinter()

Platform::StackTracePrinter v8::platform::DefaultPlatform::GetStackTracePrinter ( )
override

Definition at line 277 of file default-platform.cc.

◆ GetThreadIsolatedAllocator()

v8::ThreadIsolatedAllocator * v8::platform::DefaultPlatform::GetThreadIsolatedAllocator ( )
override

Definition at line 285 of file default-platform.cc.

Here is the call graph for this function:

◆ GetTracingController()

TracingController * v8::platform::DefaultPlatform::GetTracingController ( )
override

Definition at line 265 of file default-platform.cc.

◆ IdleTasksEnabled()

bool v8::platform::DefaultPlatform::IdleTasksEnabled ( Isolate * isolate)
override

Definition at line 241 of file default-platform.cc.

◆ MonotonicallyIncreasingTime()

double v8::platform::DefaultPlatform::MonotonicallyIncreasingTime ( )
override

Definition at line 256 of file default-platform.cc.

Here is the caller graph for this function:

◆ NotifyIsolateShutdown()

void v8::platform::DefaultPlatform::NotifyIsolateShutdown ( Isolate * isolate)

Definition at line 292 of file default-platform.cc.

◆ num_worker_runners()

int v8::platform::DefaultPlatform::num_worker_runners ( ) const
inlineprivate

Definition at line 101 of file default-platform.h.

Here is the caller graph for this function:

◆ NumberOfWorkerThreads()

int v8::platform::DefaultPlatform::NumberOfWorkerThreads ( )
override

Definition at line 275 of file default-platform.cc.

Here is the caller graph for this function:

◆ operator=()

DefaultPlatform & v8::platform::DefaultPlatform::operator= ( const DefaultPlatform & )
delete
Here is the call graph for this function:

◆ PostDelayedTaskOnWorkerThreadImpl()

void v8::platform::DefaultPlatform::PostDelayedTaskOnWorkerThreadImpl ( TaskPriority priority,
std::unique_ptr< Task > task,
double delay_in_seconds,
const SourceLocation & location )
override

Definition at line 227 of file default-platform.cc.

Here is the call graph for this function:

◆ PostTaskOnWorkerThreadImpl()

void v8::platform::DefaultPlatform::PostTaskOnWorkerThreadImpl ( TaskPriority priority,
std::unique_ptr< Task > task,
const SourceLocation & location )
override

Definition at line 214 of file default-platform.cc.

Here is the call graph for this function:

◆ priority_from_index()

base::Thread::Priority v8::platform::DefaultPlatform::priority_from_index ( int i) const
inlineprivate

Definition at line 80 of file default-platform.h.

Here is the caller graph for this function:

◆ priority_to_index()

int v8::platform::DefaultPlatform::priority_to_index ( TaskPriority priority) const
inlineprivate

Definition at line 94 of file default-platform.h.

Here is the caller graph for this function:

◆ PumpMessageLoop()

bool v8::platform::DefaultPlatform::PumpMessageLoop ( v8::Isolate * isolate,
MessageLoopBehavior behavior = MessageLoopBehavior::kDoNotWait )

Definition at line 158 of file default-platform.cc.

◆ RunIdleTasks()

void v8::platform::DefaultPlatform::RunIdleTasks ( v8::Isolate * isolate,
double idle_time_in_seconds )

Definition at line 177 of file default-platform.cc.

Here is the call graph for this function:

◆ SetTimeFunctionForTesting()

void v8::platform::DefaultPlatform::SetTimeFunctionForTesting ( DefaultPlatform::TimeFunction time_function)

Definition at line 150 of file default-platform.cc.

◆ SetTracingController()

void v8::platform::DefaultPlatform::SetTracingController ( std::unique_ptr< v8::TracingController > tracing_controller)

Definition at line 269 of file default-platform.cc.

Member Data Documentation

◆ foreground_task_runner_map_

std::map<v8::Isolate*, std::shared_ptr<DefaultForegroundTaskRunner> > v8::platform::DefaultPlatform::foreground_task_runner_map_
private

Definition at line 111 of file default-platform.h.

◆ idle_task_support_

IdleTaskSupport v8::platform::DefaultPlatform::idle_task_support_
private

Definition at line 107 of file default-platform.h.

◆ lock_

base::Mutex v8::platform::DefaultPlatform::lock_
private

Definition at line 105 of file default-platform.h.

◆ page_allocator_

std::unique_ptr<PageAllocator> v8::platform::DefaultPlatform::page_allocator_
private

Definition at line 114 of file default-platform.h.

◆ priority_mode_

const PriorityMode v8::platform::DefaultPlatform::priority_mode_
private

Definition at line 117 of file default-platform.h.

◆ thread_isolated_allocator_

DefaultThreadIsolatedAllocator v8::platform::DefaultPlatform::thread_isolated_allocator_
private

Definition at line 115 of file default-platform.h.

◆ thread_pool_size_

const int v8::platform::DefaultPlatform::thread_pool_size_
private

Definition at line 106 of file default-platform.h.

◆ time_function_for_testing_

TimeFunction v8::platform::DefaultPlatform::time_function_for_testing_ = nullptr
private

Definition at line 118 of file default-platform.h.

◆ tracing_controller_

std::unique_ptr<TracingController> v8::platform::DefaultPlatform::tracing_controller_
private

Definition at line 113 of file default-platform.h.

◆ worker_threads_task_runners_

std::shared_ptr<DefaultWorkerThreadsTaskRunner> v8::platform::DefaultPlatform::worker_threads_task_runners_[static_cast< int >(TaskPriority::kMaxPriority)+1] = {0}
private

Definition at line 108 of file default-platform.h.


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