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

#include <default-job.h>

Inheritance diagram for v8::platform::DefaultJobState::JobDelegate:
Collaboration diagram for v8::platform::DefaultJobState::JobDelegate:

Public Member Functions

 JobDelegate (DefaultJobState *outer, bool is_joining_thread=false)
 
 ~JobDelegate ()
 
void NotifyConcurrencyIncrease () override
 
bool ShouldYield () override
 
uint8_t GetTaskId () override
 
bool IsJoiningThread () const override
 
- Public Member Functions inherited from v8::JobDelegate

Private Attributes

DefaultJobStateouter_
 
uint8_t task_id_ = kInvalidTaskId
 
bool is_joining_thread_
 
bool was_told_to_yield_ = false
 

Static Private Attributes

static constexpr uint8_t kInvalidTaskId
 

Detailed Description

Definition at line 22 of file default-job.h.

Constructor & Destructor Documentation

◆ JobDelegate()

v8::platform::DefaultJobState::JobDelegate::JobDelegate ( DefaultJobState * outer,
bool is_joining_thread = false )
inlineexplicit

Definition at line 24 of file default-job.h.

◆ ~JobDelegate()

v8::platform::DefaultJobState::JobDelegate::~JobDelegate ( )

Definition at line 19 of file default-job.cc.

Here is the call graph for this function:

Member Function Documentation

◆ GetTaskId()

uint8_t v8::platform::DefaultJobState::JobDelegate::GetTaskId ( )
overridevirtual

Returns a task_id unique among threads currently running this job, such that GetTaskId() < worker count. To achieve this, the same task_id may be reused by a different thread after a worker_task returns.

Implements v8::JobDelegate.

Definition at line 26 of file default-job.cc.

◆ IsJoiningThread()

bool v8::platform::DefaultJobState::JobDelegate::IsJoiningThread ( ) const
inlineoverridevirtual

Returns true if the current task is called from the thread currently running JobHandle::Join().

Implements v8::JobDelegate.

Definition at line 42 of file default-job.h.

◆ NotifyConcurrencyIncrease()

void v8::platform::DefaultJobState::JobDelegate::NotifyConcurrencyIncrease ( )
inlineoverridevirtual

Notifies the scheduler that max concurrency was increased, and the number of worker should be adjusted accordingly. See Platform::PostJob() for more details.

Implements v8::JobDelegate.

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

◆ ShouldYield()

bool v8::platform::DefaultJobState::JobDelegate::ShouldYield ( )
inlineoverridevirtual

Returns true if this thread must return from the worker task on the current thread ASAP. Workers should periodically invoke ShouldYield (or YieldIfNeeded()) as often as is reasonable. After this method returned true, ShouldYield must not be called again.

Implements v8::JobDelegate.

Definition at line 31 of file default-job.h.

Member Data Documentation

◆ is_joining_thread_

bool v8::platform::DefaultJobState::JobDelegate::is_joining_thread_
private

Definition at line 50 of file default-job.h.

◆ kInvalidTaskId

uint8_t v8::platform::DefaultJobState::JobDelegate::kInvalidTaskId
staticconstexprprivate
Initial value:
=
std::numeric_limits<uint8_t>::max()

Definition at line 45 of file default-job.h.

◆ outer_

DefaultJobState* v8::platform::DefaultJobState::JobDelegate::outer_
private

Definition at line 48 of file default-job.h.

◆ task_id_

uint8_t v8::platform::DefaultJobState::JobDelegate::task_id_ = kInvalidTaskId
private

Definition at line 49 of file default-job.h.

◆ was_told_to_yield_

bool v8::platform::DefaultJobState::JobDelegate::was_told_to_yield_ = false
private

Definition at line 51 of file default-job.h.


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