V8 API Reference, 7.2.502.16 (for Deno 0.2.4)
v8::DelayedTasksPlatform Class Reference
Inheritance diagram for v8::DelayedTasksPlatform:
v8::Platform

Public Member Functions

 DelayedTasksPlatform (std::unique_ptr< Platform > platform)
 
 DelayedTasksPlatform (std::unique_ptr< Platform > platform, int64_t random_seed)
 
PageAllocatorGetPageAllocator () override
 
void OnCriticalMemoryPressure () override
 
bool OnCriticalMemoryPressure (size_t length) override
 
std::shared_ptr< TaskRunnerGetForegroundTaskRunner (v8::Isolate *isolate) override
 
int NumberOfWorkerThreads () override
 
void CallOnWorkerThread (std::unique_ptr< Task > task) override
 
void CallDelayedOnWorkerThread (std::unique_ptr< Task > task, double delay_in_seconds) override
 
void CallOnForegroundThread (v8::Isolate *isolate, Task *task) override
 
void CallDelayedOnForegroundThread (v8::Isolate *isolate, Task *task, double delay_in_seconds) override
 
void CallIdleOnForegroundThread (Isolate *isolate, IdleTask *task) override
 
bool IdleTasksEnabled (Isolate *isolate) override
 
double MonotonicallyIncreasingTime () override
 
double CurrentClockTimeMillis () override
 
v8::TracingControllerGetTracingController () override
 
- Public Member Functions inherited from v8::Platform
virtual void CallBlockingTaskOnWorkerThread (std::unique_ptr< Task > task)
 
 V8_DEPRECATE_SOON ("Use a taskrunner acquired by GetForegroundTaskRunner instead.", virtual void CallOnForegroundThread(Isolate *isolate, Task *task))=0
 
 V8_DEPRECATE_SOON ("Use a taskrunner acquired by GetForegroundTaskRunner instead.", virtual void CallDelayedOnForegroundThread(Isolate *isolate, Task *task, double delay_in_seconds))=0
 
 V8_DEPRECATE_SOON ("Use a taskrunner acquired by GetForegroundTaskRunner instead.", virtual void CallIdleOnForegroundThread(Isolate *isolate, IdleTask *task))
 
virtual StackTracePrinter GetStackTracePrinter ()
 
virtual void DumpWithoutCrashing ()
 

Additional Inherited Members

- Public Types inherited from v8::Platform
typedef void(* StackTracePrinter) ()
 
- Static Protected Member Functions inherited from v8::Platform
static double SystemClockTimeMillis ()
 

Detailed Description

Definition at line 100 of file d8-platforms.cc.

Member Function Documentation

◆ CallDelayedOnWorkerThread()

void v8::DelayedTasksPlatform::CallDelayedOnWorkerThread ( std::unique_ptr< Task task,
double  delay_in_seconds 
)
inlineoverridevirtual

Schedules a task to be invoked on a worker thread after |delay_in_seconds| expires.

Implements v8::Platform.

Definition at line 160 of file d8-platforms.cc.

◆ CallOnWorkerThread()

void v8::DelayedTasksPlatform::CallOnWorkerThread ( std::unique_ptr< Task task)
inlineoverridevirtual

Schedules a task to be invoked on a worker thread.

Implements v8::Platform.

Definition at line 156 of file d8-platforms.cc.

◆ CurrentClockTimeMillis()

double v8::DelayedTasksPlatform::CurrentClockTimeMillis ( )
inlineoverridevirtual

Current wall-clock time in milliseconds since epoch. This function is expected to return at least millisecond-precision values.

Implements v8::Platform.

Definition at line 190 of file d8-platforms.cc.

◆ GetForegroundTaskRunner()

std::shared_ptr<TaskRunner> v8::DelayedTasksPlatform::GetForegroundTaskRunner ( v8::Isolate *  isolate)
inlineoverridevirtual

Returns a TaskRunner which can be used to post a task on the foreground. This function should only be called from a foreground thread.

Implements v8::Platform.

Definition at line 130 of file d8-platforms.cc.

◆ GetPageAllocator()

PageAllocator* v8::DelayedTasksPlatform::GetPageAllocator ( )
inlineoverridevirtual

Allows the embedder to manage memory page allocations.

Reimplemented from v8::Platform.

Definition at line 118 of file d8-platforms.cc.

◆ GetTracingController()

v8::TracingController* v8::DelayedTasksPlatform::GetTracingController ( )
inlineoverridevirtual

Returns an instance of a v8::TracingController. This must be non-nullptr.

Implements v8::Platform.

Definition at line 194 of file d8-platforms.cc.

◆ IdleTasksEnabled()

bool v8::DelayedTasksPlatform::IdleTasksEnabled ( Isolate *  isolate)
inlineoverridevirtual

Returns true if idle tasks are enabled for the given |isolate|.

Reimplemented from v8::Platform.

Definition at line 182 of file d8-platforms.cc.

◆ MonotonicallyIncreasingTime()

double v8::DelayedTasksPlatform::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 v8::Platform.

Definition at line 186 of file d8-platforms.cc.

◆ NumberOfWorkerThreads()

int v8::DelayedTasksPlatform::NumberOfWorkerThreads ( )
inlineoverridevirtual

Gets the number of worker threads used by Call(BlockingTask)OnWorkerThread(). This can be used to estimate the number of tasks a work package should be split into. A return value of 0 means that there are no worker threads available. Note that a value of 0 won't prohibit V8 from posting tasks using |CallOnWorkerThread|.

Implements v8::Platform.

Definition at line 152 of file d8-platforms.cc.

◆ OnCriticalMemoryPressure() [1/2]

void v8::DelayedTasksPlatform::OnCriticalMemoryPressure ( )
inlineoverridevirtual

Enables the embedder to respond in cases where V8 can't allocate large blocks of memory. V8 retries the failed allocation once after calling this method. On success, execution continues; otherwise V8 exits with a fatal error. Embedder overrides of this function must NOT call back into V8.

Reimplemented from v8::Platform.

Definition at line 122 of file d8-platforms.cc.

◆ OnCriticalMemoryPressure() [2/2]

bool v8::DelayedTasksPlatform::OnCriticalMemoryPressure ( size_t  length)
inlineoverridevirtual

Enables the embedder to respond in cases where V8 can't allocate large memory regions. The |length| parameter is the amount of memory needed. Returns true if memory is now available. Returns false if no memory could be made available. V8 will retry allocations until this method returns false.

Embedder overrides of this function must NOT call back into V8.

Reimplemented from v8::Platform.

Definition at line 126 of file d8-platforms.cc.


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