summaryrefslogtreecommitdiff
path: root/core/extensions.rs
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2022-10-27 06:40:48 -0700
committerGitHub <noreply@github.com>2022-10-27 19:10:48 +0530
commit02187966c108fd50354c8de57bab443a5b262373 (patch)
tree8076ec580cef65797897303a6bb3866f74227bd3 /core/extensions.rs
parentbfd9912e1faa30a92472252b77878714e668a3d4 (diff)
perf(core): generate inlined wrappers for async ops (#16428)
V8's JIT can do a better job knowing the argument count and also enable fast call path (in future). This also lets us call async ops without `opAsync`: ```js const { ops } = Deno.core; await ops.op_void_async(); ``` this patch: 4405286 ops/sec main: 3508771 ops/sec
Diffstat (limited to 'core/extensions.rs')
-rw-r--r--core/extensions.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/extensions.rs b/core/extensions.rs
index 846770d1f..7b9ab5908 100644
--- a/core/extensions.rs
+++ b/core/extensions.rs
@@ -16,6 +16,9 @@ pub struct OpDecl {
pub enabled: bool,
pub is_async: bool,
pub is_unstable: bool,
+ /// V8 argument count. Used as an optimization
+ /// hint by `core.initalizeAsyncOps`.
+ pub argc: usize,
pub is_v8: bool,
pub fast_fn: Option<Box<dyn FastFunction>>,
}