summaryrefslogtreecommitdiff
path: root/core/ops_builtin.rs
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2022-07-22 17:54:22 +0530
committerGitHub <noreply@github.com>2022-07-22 17:54:22 +0530
commit03dc3b8972f460e40d0b75fc3207cae9fe4f60da (patch)
tree410bc92530e34ca2eee8a154f705be85ae9641b3 /core/ops_builtin.rs
parent244c00d95b7ec8f30a5e81b743b4b618049b6c37 (diff)
feat(ops): V8 Fast Calls (#15122)
Co-authored-by: Bartek IwaƄczuk <biwanczuk@gmail.com>
Diffstat (limited to 'core/ops_builtin.rs')
-rw-r--r--core/ops_builtin.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/core/ops_builtin.rs b/core/ops_builtin.rs
index a42c0bae8..2e911e415 100644
--- a/core/ops_builtin.rs
+++ b/core/ops_builtin.rs
@@ -31,6 +31,7 @@ pub(crate) fn init_builtins() -> Extension {
op_wasm_streaming_set_url::decl(),
op_void_sync::decl(),
op_void_async::decl(),
+ op_add::decl(),
// // TODO(@AaronO): track IO metrics for builtin streams
op_read::decl(),
op_write::decl(),
@@ -54,7 +55,12 @@ pub fn op_resources(state: &mut OpState) -> Vec<(ResourceId, String)> {
.collect()
}
-#[op]
+#[op(fast)]
+fn op_add(a: i32, b: i32) -> i32 {
+ a + b
+}
+
+#[op(fast)]
pub fn op_void_sync() {}
#[op]