summaryrefslogtreecommitdiff
path: root/runtime/js/40_process.js
diff options
context:
space:
mode:
authorMatt Mastracci <matthew@mastracci.com>2023-12-26 18:30:26 -0700
committerGitHub <noreply@github.com>2023-12-27 02:30:26 +0100
commit0efe438f7c191d8504355e03b27fe7e3055c9387 (patch)
treeb96fe9a897eb6941c87a95a04520662d26c02fbe /runtime/js/40_process.js
parente33c5eb704c22fad69876e87d9b852a4e5072a7a (diff)
perf: remove opAsync (#21690)
`opAsync` requires a lookup by name on each async call. This is a mechanical translation of all opAsync calls to ensureFastOps. The `opAsync` API on Deno.core will be removed at a later time.
Diffstat (limited to 'runtime/js/40_process.js')
-rw-r--r--runtime/js/40_process.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/runtime/js/40_process.js b/runtime/js/40_process.js
index e628aeb4a..9239f8e99 100644
--- a/runtime/js/40_process.js
+++ b/runtime/js/40_process.js
@@ -30,6 +30,10 @@ import {
ReadableStreamPrototype,
writableStreamForRid,
} from "ext:deno_web/06_streams.js";
+const {
+ op_run_status,
+ op_spawn_wait,
+} = core.ensureFastOps();
function opKill(pid, signo, apiName) {
ops.op_kill(pid, signo, apiName);
@@ -40,7 +44,7 @@ function kill(pid, signo = "SIGTERM") {
}
function opRunStatus(rid) {
- return core.opAsync("op_run_status", rid);
+ return op_run_status(rid);
}
function opRun(request) {
@@ -272,7 +276,7 @@ class ChildProcess {
const onAbort = () => this.kill("SIGTERM");
signal?.[abortSignal.add](onAbort);
- const waitPromise = core.opAsync("op_spawn_wait", this.#rid);
+ const waitPromise = op_spawn_wait(this.#rid);
this.#waitPromise = waitPromise;
this.#status = PromisePrototypeThen(waitPromise, (res) => {
signal?.[abortSignal.remove](onAbort);