Skip to content

Commit

Permalink
src: Implement NodePlatform::PostJob
Browse files Browse the repository at this point in the history
V8 is starting to use the job API for Wasm compilation, so the node
platform should implement that.
  • Loading branch information
backes authored and targos committed Sep 29, 2020
1 parent bb5df24 commit 0ee6c2c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/node_platform.cc
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,12 @@ bool NodePlatform::FlushForegroundTasks(Isolate* isolate) {
return per_isolate->FlushForegroundTasksInternal();
}

std::unique_ptr<v8::JobHandle> NodePlatform::PostJob(v8::TaskPriority priority,
std::unique_ptr<v8::JobTask> job_task) {
return v8::platform::NewDefaultJobHandle(
this, priority, std::move(job_task), NumberOfWorkerThreads());
}

bool NodePlatform::IdleTasksEnabled(Isolate* isolate) {
return ForIsolate(isolate)->IdleTasksEnabled();
}
Expand Down
3 changes: 3 additions & 0 deletions src/node_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ class NodePlatform : public MultiIsolatePlatform {
double CurrentClockTimeMillis() override;
v8::TracingController* GetTracingController() override;
bool FlushForegroundTasks(v8::Isolate* isolate) override;
std::unique_ptr<v8::JobHandle> PostJob(
v8::TaskPriority priority,
std::unique_ptr<v8::JobTask> job_task) override;

void RegisterIsolate(v8::Isolate* isolate, uv_loop_t* loop) override;
void RegisterIsolate(v8::Isolate* isolate,
Expand Down

0 comments on commit 0ee6c2c

Please sign in to comment.