From 722ea20e860df0a568b5d97734ad8d89aa7382a9 Mon Sep 17 00:00:00 2001 From: Aapo Alasuutari Date: Thu, 20 Oct 2022 07:05:56 +0300 Subject: perf(ext/ffi): Fast UnsafePointerView read functions (#16351) This PR makes pointer read methods of `Deno.UnsafePointerView` Fast API compliant, with the exception of `getCString` which cannot be made fast with current V8 Fast API. --- ops/lib.rs | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'ops') diff --git a/ops/lib.rs b/ops/lib.rs index 3200a6d34..adc50e69c 100644 --- a/ops/lib.rs +++ b/ops/lib.rs @@ -774,6 +774,35 @@ fn is_fast_scalar( match tokens(&ty).as_str() { "u32" => Some(quote! { #core::v8::fast_api::#cty::Uint32 }), "i32" => Some(quote! { #core::v8::fast_api::#cty::Int32 }), + "u64" => { + if is_ret { + None + } else { + Some(quote! { #core::v8::fast_api::#cty::Uint64 }) + } + } + "i64" => { + if is_ret { + None + } else { + Some(quote! { #core::v8::fast_api::#cty::Int64 }) + } + } + // TODO(@aapoalas): Support 32 bit machines + "usize" => { + if is_ret { + None + } else { + Some(quote! { #core::v8::fast_api::#cty::Uint64 }) + } + } + "isize" => { + if is_ret { + None + } else { + Some(quote! { #core::v8::fast_api::#cty::Int64 }) + } + } "f32" => Some(quote! { #core::v8::fast_api::#cty::Float32 }), "f64" => Some(quote! { #core::v8::fast_api::#cty::Float64 }), "bool" => Some(quote! { #core::v8::fast_api::#cty::Bool }), -- cgit v1.2.3