diff options
author | Aapo Alasuutari <aapo.alasuutari@gmail.com> | 2022-10-20 07:05:56 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-20 09:35:56 +0530 |
commit | 722ea20e860df0a568b5d97734ad8d89aa7382a9 (patch) | |
tree | 7b5dea0f32318dcc8d7d98b0cc6d4a3384a5805c /ops/lib.rs | |
parent | 973069b341de65e8e32b91072ff5a745fe7e704a (diff) |
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.
Diffstat (limited to 'ops/lib.rs')
-rw-r--r-- | ops/lib.rs | 29 |
1 files changed, 29 insertions, 0 deletions
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 }), |