v8 12.4.254 (node 22.4.1)
V8 is Google's open source JavaScript engine
Loading...
Searching...
No Matches
DefaultPlatform Class Reference

#include <default-platform.h>

Inheritance diagram for DefaultPlatform:
Collaboration diagram for DefaultPlatform:

Public Types

using IdleTaskSupport = v8::platform::IdleTaskSupport
 

Public Member Functions

 DefaultPlatform (int thread_pool_size=0, IdleTaskSupport idle_task_support=IdleTaskSupport::kDisabled, std::unique_ptr< TracingController > tracing_controller={})
 
cppgc::PageAllocatorGetPageAllocator () override
 
double MonotonicallyIncreasingTime () override
 
std::shared_ptr< cppgc::TaskRunnerGetForegroundTaskRunner () override
 
std::unique_ptr< cppgc::JobHandlePostJob (cppgc::TaskPriority priority, std::unique_ptr< cppgc::JobTask > job_task) override
 
TracingControllerGetTracingController () override
 
v8::PlatformGetV8Platform () const
 
- Public Member Functions inherited from Platform
virtual ~Platform ()=default
 
virtual PageAllocatorGetPageAllocator ()=0
 
virtual double MonotonicallyIncreasingTime ()=0
 
virtual std::shared_ptr< TaskRunnerGetForegroundTaskRunner ()
 
virtual std::unique_ptr< JobHandlePostJob (TaskPriority priority, std::unique_ptr< JobTask > job_task)
 
virtual TracingControllerGetTracingController ()
 

Protected Attributes

std::unique_ptr< v8::Platformv8_platform_
 

Static Protected Attributes

static constexpr v8::IsolatekNoIsolate = nullptr
 

Detailed Description

Platform provided by cppgc. Uses V8's DefaultPlatform provided by libplatform internally. Exception: GetForegroundTaskRunner(), see below.

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

Member Typedef Documentation

◆ IdleTaskSupport

Constructor & Destructor Documentation

◆ DefaultPlatform()

DefaultPlatform ( int  thread_pool_size = 0,
IdleTaskSupport  idle_task_support = IdleTaskSupport::kDisabled,
std::unique_ptr< TracingController tracing_controller = {} 
)
inlineexplicit

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

Member Function Documentation

◆ GetForegroundTaskRunner()

std::shared_ptr< cppgc::TaskRunner > GetForegroundTaskRunner ( )
inlineoverridevirtual

Foreground task runner that should be used by a Heap.

Reimplemented from Platform.

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

◆ GetPageAllocator()

cppgc::PageAllocator * GetPageAllocator ( )
inlineoverridevirtual
Returns
the allocator used by cppgc to allocate its heap and various support structures. Returning nullptr results in using the PageAllocator provided by cppgc::InitializeProcess() instead.

Implements Platform.

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

◆ GetTracingController()

TracingController * GetTracingController ( )
inlineoverridevirtual

Returns an instance of a TracingController. This must be non-nullptr. The default implementation returns an empty TracingController that consumes trace data without effect.

Reimplemented from Platform.

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

◆ GetV8Platform()

v8::Platform * GetV8Platform ( ) const
inline

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

◆ MonotonicallyIncreasingTime()

double MonotonicallyIncreasingTime ( )
inlineoverridevirtual

Monotonically increasing time in seconds from an arbitrary fixed point in the past. This function is expected to return at least millisecond-precision values. For this reason, it is recommended that the fixed point be no further in the past than the epoch.

Implements Platform.

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

◆ PostJob()

std::unique_ptr< cppgc::JobHandle > PostJob ( cppgc::TaskPriority  priority,
std::unique_ptr< cppgc::JobTask job_task 
)
inlineoverride

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

Field Documentation

◆ kNoIsolate

constexpr v8::Isolate* kNoIsolate = nullptr
staticconstexprprotected

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

◆ v8_platform_

std::unique_ptr<v8::Platform> v8_platform_
protected

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


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