feat: port node:zlib to rust (#18291)

This commit is contained in:
Divy Srivastava 2023-03-27 21:33:07 +05:30 committed by GitHub
parent 9ebce6e725
commit b2fd0742bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 897 additions and 7471 deletions

View file

@ -329,6 +329,7 @@ pub(crate) fn generate(
let fast_fn = q!(
Vars { core, pre_transforms, op_name_fast: &fast_fn_ident, op_name: &ident, fast_fn_inputs, generics, call_generics: &caller_generics, where_clause, idents, transforms, output_transforms, output: &output },
{
#[allow(clippy::too_many_arguments)]
fn op_name_fast generics (_: core::v8::Local<core::v8::Object>, fast_fn_inputs) -> output where_clause {
use core::v8;
use core::_ops;

View file

@ -253,7 +253,7 @@ fn codegen_v8_async(
let rust_i0 = special_args.len();
let args_head = special_args.into_iter().collect::<TokenStream2>();
let (arg_decls, args_tail, _) = codegen_args(core, f, rust_i0, 1, true);
let (arg_decls, args_tail, _) = codegen_args(core, f, rust_i0, 1, asyncness);
let type_params = exclude_lifetime_params(&f.sig.generics.params);
let (pre_result, mut result_fut) = match asyncness {

View file

@ -101,6 +101,7 @@ impl<'scope> deno_core::v8::fast_api::FastFunction for op_void_async_fast {
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>,
__promise_id: i32,

View file

@ -111,6 +111,7 @@ impl<'scope> deno_core::v8::fast_api::FastFunction for op_async_result_fast {
deno_core::v8::fast_api::CType::Void
}
}
#[allow(clippy::too_many_arguments)]
fn op_async_result_fast_fn<'scope>(
_: deno_core::v8::Local<deno_core::v8::Object>,
__promise_id: i32,

View file

@ -70,6 +70,7 @@ impl<'scope> deno_core::v8::fast_api::FastFunction for op_fallback_fast {
deno_core::v8::fast_api::CType::Void
}
}
#[allow(clippy::too_many_arguments)]
fn op_fallback_fast_fn<'scope>(
_: deno_core::v8::Local<deno_core::v8::Object>,
fast_api_callback_options: *mut deno_core::v8::fast_api::FastApiCallbackOptions,

View file

@ -78,6 +78,7 @@ impl<'scope> deno_core::v8::fast_api::FastFunction for op_cow_str_fast {
deno_core::v8::fast_api::CType::Void
}
}
#[allow(clippy::too_many_arguments)]
fn op_cow_str_fast_fn<'scope>(
_: deno_core::v8::Local<deno_core::v8::Object>,
c: *const deno_core::v8::fast_api::FastApiOneByteString,

View file

@ -96,6 +96,7 @@ impl<'scope> deno_core::v8::fast_api::FastFunction for op_f64_buf_fast {
deno_core::v8::fast_api::CType::Void
}
}
#[allow(clippy::too_many_arguments)]
fn op_f64_buf_fast_fn<'scope>(
_: deno_core::v8::Local<deno_core::v8::Object>,
buffer: *const deno_core::v8::fast_api::FastApiTypedArray<f64>,

View file

@ -110,6 +110,7 @@ impl<'scope> deno_core::v8::fast_api::FastFunction for op_ffi_ptr_value_fast {
deno_core::v8::fast_api::CType::Void
}
}
#[allow(clippy::too_many_arguments)]
fn op_ffi_ptr_value_fast_fn<'scope>(
_: deno_core::v8::Local<deno_core::v8::Object>,
ptr: *mut ::std::ffi::c_void,

View file

@ -78,6 +78,7 @@ impl<'scope> deno_core::v8::fast_api::FastFunction for op_set_exit_code_fast {
deno_core::v8::fast_api::CType::Void
}
}
#[allow(clippy::too_many_arguments)]
fn op_set_exit_code_fast_fn<'scope>(
_: deno_core::v8::Local<deno_core::v8::Object>,
code: i32,

View file

@ -105,6 +105,7 @@ impl<'scope> deno_core::v8::fast_api::FastFunction for foo_fast {
deno_core::v8::fast_api::CType::Uint32
}
}
#[allow(clippy::too_many_arguments)]
fn foo_fast_fn<'scope>(
_: deno_core::v8::Local<deno_core::v8::Object>,
a: u32,

View file

@ -80,6 +80,7 @@ where
deno_core::v8::fast_api::CType::Void
}
}
#[allow(clippy::too_many_arguments)]
fn op_foo_fast_fn<'scope, SP>(
_: deno_core::v8::Local<deno_core::v8::Object>,
fast_api_callback_options: *mut deno_core::v8::fast_api::FastApiCallbackOptions,

View file

@ -118,6 +118,7 @@ impl<'scope> deno_core::v8::fast_api::FastFunction for foo_fast {
deno_core::v8::fast_api::CType::Uint32
}
}
#[allow(clippy::too_many_arguments)]
fn foo_fast_fn<'scope>(
_: deno_core::v8::Local<deno_core::v8::Object>,
a: u32,

View file

@ -109,6 +109,7 @@ impl<'scope> deno_core::v8::fast_api::FastFunction for op_listen_fast {
deno_core::v8::fast_api::CType::Uint32
}
}
#[allow(clippy::too_many_arguments)]
fn op_listen_fast_fn<'scope>(
_: deno_core::v8::Local<deno_core::v8::Object>,
fast_api_callback_options: *mut deno_core::v8::fast_api::FastApiCallbackOptions,

View file

@ -127,6 +127,7 @@ where
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>,
buf: *const deno_core::v8::fast_api::FastApiTypedArray<u8>,

View file

@ -136,6 +136,7 @@ impl<'scope> deno_core::v8::fast_api::FastFunction for op_add_4_fast {
deno_core::v8::fast_api::CType::Uint32
}
}
#[allow(clippy::too_many_arguments)]
fn op_add_4_fast_fn<'scope>(
_: deno_core::v8::Local<deno_core::v8::Object>,
x1: u32,

View file

@ -90,6 +90,7 @@ impl<'scope> deno_core::v8::fast_api::FastFunction for op_string_length_fast {
deno_core::v8::fast_api::CType::Uint32
}
}
#[allow(clippy::too_many_arguments)]
fn op_string_length_fast_fn<'scope>(
_: deno_core::v8::Local<deno_core::v8::Object>,
string: *const deno_core::v8::fast_api::FastApiOneByteString,

View file

@ -153,6 +153,7 @@ where
deno_core::v8::fast_api::CType::Void
}
}
#[allow(clippy::too_many_arguments)]
fn op_ffi_ptr_of_fast_fn<'scope, FP>(
_: deno_core::v8::Local<deno_core::v8::Object>,
buf: *const deno_core::v8::fast_api::FastApiTypedArray<u8>,

View file

@ -90,6 +90,7 @@ impl<'scope> deno_core::v8::fast_api::FastFunction for op_is_proxy_fast {
deno_core::v8::fast_api::CType::Bool
}
}
#[allow(clippy::too_many_arguments)]
fn op_is_proxy_fast_fn<'scope>(
_: deno_core::v8::Local<deno_core::v8::Object>,
value: deno_core::v8::Local<v8::Value>,

View file

@ -91,6 +91,7 @@ impl<'scope> deno_core::v8::fast_api::FastFunction for op_string_length_fast {
deno_core::v8::fast_api::CType::Uint32
}
}
#[allow(clippy::too_many_arguments)]
fn op_string_length_fast_fn<'scope>(
_: deno_core::v8::Local<deno_core::v8::Object>,
string: *const deno_core::v8::fast_api::FastApiOneByteString,

View file

@ -167,6 +167,7 @@ impl<'scope> deno_core::v8::fast_api::FastFunction for op_import_spki_x25519_fas
deno_core::v8::fast_api::CType::Bool
}
}
#[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>,

View file

@ -90,6 +90,7 @@ impl<'scope> deno_core::v8::fast_api::FastFunction for op_unit_result_fast {
deno_core::v8::fast_api::CType::Void
}
}
#[allow(clippy::too_many_arguments)]
fn op_unit_result_fast_fn<'scope>(
_: deno_core::v8::Local<deno_core::v8::Object>,
fast_api_callback_options: *mut deno_core::v8::fast_api::FastApiCallbackOptions,

View file

@ -123,6 +123,7 @@ impl<'scope> deno_core::v8::fast_api::FastFunction for op_set_nodelay_fast {
deno_core::v8::fast_api::CType::Void
}
}
#[allow(clippy::too_many_arguments)]
fn op_set_nodelay_fast_fn<'scope>(
_: deno_core::v8::Local<deno_core::v8::Object>,
rid: ResourceId,

View file

@ -79,6 +79,7 @@ impl<'scope> deno_core::v8::fast_api::FastFunction for op_unit_fast {
deno_core::v8::fast_api::CType::Void
}
}
#[allow(clippy::too_many_arguments)]
fn op_unit_fast_fn<'scope>(_: deno_core::v8::Local<deno_core::v8::Object>) -> () {
use deno_core::v8;
use deno_core::_ops;

View file

@ -66,6 +66,7 @@ impl<'scope> deno_core::v8::fast_api::FastFunction for op_wasm_fast {
deno_core::v8::fast_api::CType::Void
}
}
#[allow(clippy::too_many_arguments)]
fn op_wasm_fast_fn<'scope>(
_: deno_core::v8::Local<deno_core::v8::Object>,
fast_api_callback_options: *mut deno_core::v8::fast_api::FastApiCallbackOptions,