diff options
Diffstat (limited to 'ops/optimizer_tests/uint8array.out')
-rw-r--r-- | ops/optimizer_tests/uint8array.out | 55 |
1 files changed, 25 insertions, 30 deletions
diff --git a/ops/optimizer_tests/uint8array.out b/ops/optimizer_tests/uint8array.out index 96980cc04..93fa40e1f 100644 --- a/ops/optimizer_tests/uint8array.out +++ b/ops/optimizer_tests/uint8array.out @@ -6,23 +6,37 @@ pub struct op_import_spki_x25519; #[doc(hidden)] impl op_import_spki_x25519 { - pub fn name() -> &'static str { + pub const fn name() -> &'static str { stringify!(op_import_spki_x25519) } - 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: Some( - Box::new(op_import_spki_x25519_fast { - _phantom: ::std::marker::PhantomData, - }), - ), + fast_fn: { + use deno_core::v8::fast_api::Type::*; + use deno_core::v8::fast_api::CType; + Some( + deno_core::v8::fast_api::FastFunction::new( + &[V8Value, TypedArray(CType::Uint8), TypedArray(CType::Uint8)], + CType::Bool, + op_import_spki_x25519_fast_fn as *const ::std::ffi::c_void, + ), + ) + }, is_async: false, is_unstable: false, is_v8: false, @@ -148,25 +162,6 @@ impl op_import_spki_x25519 { }; } } -struct op_import_spki_x25519_fast { - _phantom: ::std::marker::PhantomData<()>, -} -impl<'scope> deno_core::v8::fast_api::FastFunction for op_import_spki_x25519_fast { - #[inline(always)] - fn function(&self) -> *const ::std::ffi::c_void { - op_import_spki_x25519_fast_fn as *const ::std::ffi::c_void - } - #[inline(always)] - fn args(&self) -> &'static [deno_core::v8::fast_api::Type] { - use deno_core::v8::fast_api::Type::*; - use deno_core::v8::fast_api::CType; - &[V8Value, TypedArray(CType::Uint8), TypedArray(CType::Uint8)] - } - #[inline(always)] - fn return_type(&self) -> deno_core::v8::fast_api::CType { - deno_core::v8::fast_api::CType::Bool - } -} #[allow(clippy::too_many_arguments)] fn op_import_spki_x25519_fast_fn<'scope>( _: deno_core::v8::Local<deno_core::v8::Object>, |