Skip to content

Commit b65e5ae

Browse files
backestargos
authored andcommitted
src: implement NodePlatform::PostJob
V8 is starting to use the job API for Wasm compilation, so the node platform should implement that. PR-URL: #35415 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
1 parent 80e8aec commit b65e5ae

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/node_platform.cc

+6
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,12 @@ bool NodePlatform::FlushForegroundTasks(Isolate* isolate) {
513513
return per_isolate->FlushForegroundTasksInternal();
514514
}
515515

516+
std::unique_ptr<v8::JobHandle> NodePlatform::PostJob(v8::TaskPriority priority,
517+
std::unique_ptr<v8::JobTask> job_task) {
518+
return v8::platform::NewDefaultJobHandle(
519+
this, priority, std::move(job_task), NumberOfWorkerThreads());
520+
}
521+
516522
bool NodePlatform::IdleTasksEnabled(Isolate* isolate) {
517523
return ForIsolate(isolate)->IdleTasksEnabled();
518524
}

src/node_platform.h

+3
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@ class NodePlatform : public MultiIsolatePlatform {
154154
double CurrentClockTimeMillis() override;
155155
v8::TracingController* GetTracingController() override;
156156
bool FlushForegroundTasks(v8::Isolate* isolate) override;
157+
std::unique_ptr<v8::JobHandle> PostJob(
158+
v8::TaskPriority priority,
159+
std::unique_ptr<v8::JobTask> job_task) override;
157160

158161
void RegisterIsolate(v8::Isolate* isolate, uv_loop_t* loop) override;
159162
void RegisterIsolate(v8::Isolate* isolate,

0 commit comments

Comments
 (0)