diff options
Diffstat (limited to 'ops/optimizer_tests/async_nop.out')
-rw-r--r-- | ops/optimizer_tests/async_nop.out | 55 |
1 files changed, 25 insertions, 30 deletions
diff --git a/ops/optimizer_tests/async_nop.out b/ops/optimizer_tests/async_nop.out index 83ffed142..5d73f2343 100644 --- a/ops/optimizer_tests/async_nop.out +++ b/ops/optimizer_tests/async_nop.out @@ -6,23 +6,37 @@ pub struct op_void_async; #[doc(hidden)] impl op_void_async { - pub fn name() -> &'static str { + pub const fn name() -> &'static str { stringify!(op_void_async) } - 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_void_async_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, Int32, CallbackOptions], + CType::Void, + op_void_async_fast_fn as *const ::std::ffi::c_void, + ), + ) + }, is_async: true, is_unstable: false, is_v8: false, @@ -82,25 +96,6 @@ impl op_void_async { ); } } -struct op_void_async_fast { - _phantom: ::std::marker::PhantomData<()>, -} -impl<'scope> deno_core::v8::fast_api::FastFunction for op_void_async_fast { - #[inline(always)] - fn function(&self) -> *const ::std::ffi::c_void { - op_void_async_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, Int32, CallbackOptions] - } - #[inline(always)] - fn return_type(&self) -> deno_core::v8::fast_api::CType { - deno_core::v8::fast_api::CType::Void - } -} #[allow(clippy::too_many_arguments)] fn op_void_async_fast_fn<'scope>( _: deno_core::v8::Local<deno_core::v8::Object>, |