summaryrefslogtreecommitdiff
path: root/runtime/js
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/js')
-rw-r--r--runtime/js/11_workers.js8
-rw-r--r--runtime/js/40_fs_events.js5
-rw-r--r--runtime/js/40_process.js8
-rw-r--r--runtime/js/40_signals.js5
-rw-r--r--runtime/js/99_main.js4
5 files changed, 23 insertions, 7 deletions
diff --git a/runtime/js/11_workers.js b/runtime/js/11_workers.js
index 60ea94bf4..e8e66848e 100644
--- a/runtime/js/11_workers.js
+++ b/runtime/js/11_workers.js
@@ -30,6 +30,10 @@ import {
MessagePortPrototype,
serializeJsMessageData,
} from "ext:deno_web/13_message_port.js";
+const {
+ op_host_recv_ctrl,
+ op_host_recv_message,
+} = core.ensureFastOps();
function createWorker(
specifier,
@@ -58,11 +62,11 @@ function hostPostMessage(id, data) {
}
function hostRecvCtrl(id) {
- return core.opAsync("op_host_recv_ctrl", id);
+ return op_host_recv_ctrl(id);
}
function hostRecvMessage(id) {
- return core.opAsync("op_host_recv_message", id);
+ return op_host_recv_message(id);
}
class Worker extends EventTarget {
diff --git a/runtime/js/40_fs_events.js b/runtime/js/40_fs_events.js
index c9d0f1feb..ba806c182 100644
--- a/runtime/js/40_fs_events.js
+++ b/runtime/js/40_fs_events.js
@@ -9,6 +9,9 @@ const {
SymbolAsyncIterator,
} = primordials;
import { SymbolDispose } from "ext:deno_web/00_infra.js";
+const {
+ op_fs_events_poll,
+} = core.ensureFastOps();
class FsWatcher {
#rid = 0;
@@ -24,7 +27,7 @@ class FsWatcher {
async next() {
try {
- const value = await core.opAsync("op_fs_events_poll", this.rid);
+ const value = await op_fs_events_poll(this.rid);
return value ? { value, done: false } : { value: undefined, done: true };
} catch (error) {
if (ObjectPrototypeIsPrototypeOf(BadResourcePrototype, error)) {
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);
diff --git a/runtime/js/40_signals.js b/runtime/js/40_signals.js
index 20771da36..7faa6a8bc 100644
--- a/runtime/js/40_signals.js
+++ b/runtime/js/40_signals.js
@@ -9,13 +9,16 @@ const {
SetPrototypeDelete,
TypeError,
} = primordials;
+const {
+ op_signal_poll,
+} = core.ensureFastOps();
function bindSignal(signo) {
return ops.op_signal_bind(signo);
}
function pollSignal(rid) {
- const promise = core.opAsync("op_signal_poll", rid);
+ const promise = op_signal_poll(rid);
core.unrefOpPromise(promise);
return promise;
}
diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js
index 0469b38bf..b67b6a0bf 100644
--- a/runtime/js/99_main.js
+++ b/runtime/js/99_main.js
@@ -141,6 +141,8 @@ let isClosing = false;
let globalDispatchEvent;
async function pollForMessages() {
+ const { op_worker_recv_message } = core.ensureFastOps();
+
if (!globalDispatchEvent) {
globalDispatchEvent = FunctionPrototypeBind(
globalThis.dispatchEvent,
@@ -148,7 +150,7 @@ async function pollForMessages() {
);
}
while (!isClosing) {
- const data = await core.opAsync("op_worker_recv_message");
+ const data = await op_worker_recv_message();
if (data === null) break;
const v = messagePort.deserializeJsMessageData(data);
const message = v[0];