From 9010b8df53cd37f0410e08c43a194667974686a2 Mon Sep 17 00:00:00 2001 From: Matt Mastracci Date: Thu, 9 Nov 2023 13:57:26 -0700 Subject: perf: remove knowledge of promise IDs from deno (#21132) We can move all promise ID knowledge to deno_core, allowing us to better experiment with promise implementation in deno_core. `{un,}refOpPromise(promise)` is equivalent to `{un,}refOp(promise[promiseIdSymbol])` --- ext/http/00_serve.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'ext/http/00_serve.js') diff --git a/ext/http/00_serve.js b/ext/http/00_serve.js index 5b931ccd1..fbd2014a7 100644 --- a/ext/http/00_serve.js +++ b/ext/http/00_serve.js @@ -44,7 +44,6 @@ const { ObjectPrototypeIsPrototypeOf, PromisePrototypeCatch, Symbol, - SymbolFor, TypeError, Uint8Array, Uint8ArrayPrototype, @@ -642,7 +641,6 @@ function serveHttpOnConnection(connection, signal, handler, onError, onListen) { function serveHttpOn(context, callback) { let ref = true; let currentPromise = null; - const promiseIdSymbol = SymbolFor("Deno.core.internalPromiseId"); const promiseErrorHandler = (error) => { // Abnormal exit @@ -666,7 +664,7 @@ function serveHttpOn(context, callback) { } currentPromise = op_http_wait(rid); if (!ref) { - core.unrefOp(currentPromise[promiseIdSymbol]); + core.unrefOpPromise(currentPromise); } req = await currentPromise; currentPromise = null; @@ -708,13 +706,13 @@ function serveHttpOn(context, callback) { ref() { ref = true; if (currentPromise) { - core.refOp(currentPromise[promiseIdSymbol]); + core.refOpPromise(currentPromise); } }, unref() { ref = false; if (currentPromise) { - core.unrefOp(currentPromise[promiseIdSymbol]); + core.unrefOpPromise(currentPromise); } }, [SymbolAsyncDispose]() { -- cgit v1.2.3