mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
src: implement NodePlatform::PostJob
V8 is starting to use the job API for Wasm compilation, so the node platform should implement that. PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
committed by
Michaël Zasso
parent
80e8aec4a5
commit
b65e5aeaa7
@@ -513,6 +513,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();
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user