summaryrefslogtreecommitdiff
path: root/ops/optimizer_tests/op_state_with_transforms.out
diff options
context:
space:
mode:
Diffstat (limited to 'ops/optimizer_tests/op_state_with_transforms.out')
-rw-r--r--ops/optimizer_tests/op_state_with_transforms.out58
1 files changed, 25 insertions, 33 deletions
diff --git a/ops/optimizer_tests/op_state_with_transforms.out b/ops/optimizer_tests/op_state_with_transforms.out
index a49e3cd0d..ad4e5335a 100644
--- a/ops/optimizer_tests/op_state_with_transforms.out
+++ b/ops/optimizer_tests/op_state_with_transforms.out
@@ -6,29 +6,43 @@
pub struct op_now;
#[doc(hidden)]
impl op_now {
- pub fn name() -> &'static str {
+ pub const fn name() -> &'static str {
stringify!(op_now)
}
- pub fn v8_fn_ptr<'scope, TP>() -> deno_core::v8::FunctionCallback
+ #[allow(clippy::not_unsafe_ptr_arg_deref)]
+ pub extern "C" fn v8_fn_ptr<'scope, TP>(
+ info: *const deno_core::v8::FunctionCallbackInfo,
+ )
where
TP: TimersPermission + 'static,
{
- use deno_core::v8::MapFnTo;
- Self::v8_func::<TP>.map_fn_to()
+ 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::<TP>(scope, args, rv);
}
- pub fn decl<'scope, TP>() -> deno_core::OpDecl
+ pub const fn decl<'scope, TP>() -> deno_core::OpDecl
where
TP: TimersPermission + 'static,
{
deno_core::OpDecl {
name: Self::name(),
- v8_fn_ptr: Self::v8_fn_ptr::<TP>(),
+ v8_fn_ptr: Self::v8_fn_ptr::<TP> as _,
enabled: true,
- fast_fn: Some(
- Box::new(op_now_fast::<TP> {
- _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), CallbackOptions],
+ CType::Void,
+ op_now_fast_fn::<TP> as *const ::std::ffi::c_void,
+ ),
+ )
+ },
is_async: false,
is_unstable: false,
is_v8: false,
@@ -105,28 +119,6 @@ impl op_now {
op_state.tracker.track_sync(ctx.id);
}
}
-struct op_now_fast<TP> {
- _phantom: ::std::marker::PhantomData<TP>,
-}
-impl<'scope, TP> deno_core::v8::fast_api::FastFunction for op_now_fast<TP>
-where
- TP: TimersPermission + 'static,
-{
- #[inline(always)]
- fn function(&self) -> *const ::std::ffi::c_void {
- op_now_fast_fn::<TP> 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), 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_now_fast_fn<'scope, TP>(
_: deno_core::v8::Local<deno_core::v8::Object>,