diff options
| author | Divy Srivastava <dj.srivastava23@gmail.com> | 2023-03-31 18:12:14 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-31 14:42:14 +0200 |
| commit | b9a379093264da47368ea9665f685016fe35bfca (patch) | |
| tree | af6fd2e56846b8d0a6d1d8d88c0bfcffbb34c4d6 /ops/optimizer_tests/issue16934.out | |
| parent | 0f41aff1d9f6c131ff69d6dd1dc053afb008a19d (diff) | |
perf: `const` op declaration (#18288)
Co-authored-by: Levente Kurusa <lkurusa@kernelstuff.org>
Co-authored-by: Bartek IwaĆczuk <biwanczuk@gmail.com>
Diffstat (limited to 'ops/optimizer_tests/issue16934.out')
| -rw-r--r-- | ops/optimizer_tests/issue16934.out | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/ops/optimizer_tests/issue16934.out b/ops/optimizer_tests/issue16934.out index 5b0b208f3..f8acf5712 100644 --- a/ops/optimizer_tests/issue16934.out +++ b/ops/optimizer_tests/issue16934.out @@ -6,17 +6,25 @@ pub struct send_stdin; #[doc(hidden)] impl send_stdin { - pub fn name() -> &'static str { + pub const fn name() -> &'static str { stringify!(send_stdin) } - pub fn v8_fn_ptr<'scope>() -> deno_core::v8::FunctionCallback { - use deno_core::v8::MapFnTo; - Self::v8_func.map_fn_to() + #[allow(clippy::not_unsafe_ptr_arg_deref)] + pub extern "C" fn v8_fn_ptr<'scope>( + info: *const deno_core::v8::FunctionCallbackInfo, + ) { + let info = unsafe { &*info }; + let scope = &mut unsafe { deno_core::v8::CallbackScope::new(info) }; + let args = deno_core::v8::FunctionCallbackArguments::from_function_callback_info( + info, + ); + let rv = deno_core::v8::ReturnValue::from_function_callback_info(info); + Self::v8_func(scope, args, rv); } - pub fn decl<'scope>() -> deno_core::OpDecl { + pub const fn decl<'scope>() -> deno_core::OpDecl { deno_core::OpDecl { name: Self::name(), - v8_fn_ptr: Self::v8_fn_ptr(), + v8_fn_ptr: Self::v8_fn_ptr as _, enabled: true, fast_fn: None, is_async: true, |
