diff options
Diffstat (limited to 'ops/optimizer_tests/uint8array.out')
-rw-r--r-- | ops/optimizer_tests/uint8array.out | 68 |
1 files changed, 48 insertions, 20 deletions
diff --git a/ops/optimizer_tests/uint8array.out b/ops/optimizer_tests/uint8array.out index 31915d2fe..335bf42f6 100644 --- a/ops/optimizer_tests/uint8array.out +++ b/ops/optimizer_tests/uint8array.out @@ -3,16 +3,39 @@ /// ///Use `op_import_spki_x25519::decl()` to get an op-declaration ///you can include in a `deno_core::Extension`. -pub struct op_import_spki_x25519; +pub struct op_import_spki_x25519 { + _phantom_data: ::std::marker::PhantomData<()>, +} +impl deno_core::_ops::Op for op_import_spki_x25519 { + const NAME: &'static str = stringify!(op_import_spki_x25519); + const DECL: deno_core::OpDecl = deno_core::OpDecl { + name: Self::name(), + v8_fn_ptr: Self::v8_fn_ptr as _, + enabled: true, + fast_fn: { + use deno_core::v8::fast_api::CType; + use deno_core::v8::fast_api::Type::*; + Some( + deno_core::v8::fast_api::FastFunction::new( + &[V8Value, TypedArray(CType::Uint8), TypedArray(CType::Uint8)], + CType::Bool, + Self::op_import_spki_x25519_fast_fn as *const ::std::ffi::c_void, + ), + ) + }, + is_async: false, + is_unstable: false, + is_v8: false, + arg_count: 0, + }; +} #[doc(hidden)] impl op_import_spki_x25519 { pub const fn name() -> &'static str { stringify!(op_import_spki_x25519) } #[allow(clippy::not_unsafe_ptr_arg_deref)] - pub extern "C" fn v8_fn_ptr<'scope>( - info: *const deno_core::v8::FunctionCallbackInfo, - ) { + pub extern "C" fn v8_fn_ptr(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( @@ -21,19 +44,19 @@ impl op_import_spki_x25519 { let rv = deno_core::v8::ReturnValue::from_function_callback_info(info); Self::v8_func(scope, args, rv); } - pub const fn decl<'scope>() -> deno_core::OpDecl { + pub const fn decl() -> deno_core::OpDecl { deno_core::OpDecl { name: Self::name(), v8_fn_ptr: Self::v8_fn_ptr as _, enabled: true, fast_fn: { - use deno_core::v8::fast_api::Type::*; use deno_core::v8::fast_api::CType; + use deno_core::v8::fast_api::Type::*; 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, + Self::op_import_spki_x25519_fast_fn as *const ::std::ffi::c_void, ), ) }, @@ -45,7 +68,8 @@ impl op_import_spki_x25519 { } #[inline] #[allow(clippy::too_many_arguments)] - pub fn call(key_data: &[u8], out: &mut [u8]) -> bool {} + #[allow(clippy::extra_unused_lifetimes)] + pub fn call<'scope>(key_data: &[u8], out: &mut [u8]) -> bool {} pub fn v8_func<'scope>( scope: &mut deno_core::v8::HandleScope<'scope>, args: deno_core::v8::FunctionCallbackArguments, @@ -162,16 +186,20 @@ impl op_import_spki_x25519 { }; } } -#[allow(clippy::too_many_arguments)] -fn op_import_spki_x25519_fast_fn<'scope>( - _: deno_core::v8::Local<deno_core::v8::Object>, - key_data: *const deno_core::v8::fast_api::FastApiTypedArray<u8>, - out: *const deno_core::v8::fast_api::FastApiTypedArray<u8>, -) -> bool { - use deno_core::v8; - use deno_core::_ops; - let key_data = unsafe { (&*key_data).get_storage_if_aligned().unwrap_unchecked() }; - let out = unsafe { (&*out).get_storage_if_aligned().unwrap_unchecked() }; - let result = op_import_spki_x25519::call(key_data, out); - result +impl op_import_spki_x25519 { + #[allow(clippy::too_many_arguments)] + fn op_import_spki_x25519_fast_fn( + _: deno_core::v8::Local<deno_core::v8::Object>, + key_data: *const deno_core::v8::fast_api::FastApiTypedArray<u8>, + out: *const deno_core::v8::fast_api::FastApiTypedArray<u8>, + ) -> bool { + use deno_core::v8; + use deno_core::_ops; + let key_data = unsafe { + (&*key_data).get_storage_if_aligned().unwrap_unchecked() + }; + let out = unsafe { (&*out).get_storage_if_aligned().unwrap_unchecked() }; + let result = Self::call(key_data, out); + result + } } |