mirror of
https://github.com/mii443/wasmer.git
synced 2025-08-30 04:09:28 +00:00
Prepare to abstract rayon away by minimizing the API we use
This commit is contained in:
@ -81,12 +81,12 @@ impl Compiler for SinglepassCompiler {
|
|||||||
let functions = function_body_inputs
|
let functions = function_body_inputs
|
||||||
.iter()
|
.iter()
|
||||||
.collect::<Vec<(LocalFunctionIndex, &FunctionBodyData<'_>)>>()
|
.collect::<Vec<(LocalFunctionIndex, &FunctionBodyData<'_>)>>()
|
||||||
.par_iter()
|
.into_par_iter()
|
||||||
.map(|(i, input)| {
|
.map(|(i, input)| {
|
||||||
let middleware_chain = self
|
let middleware_chain = self
|
||||||
.config
|
.config
|
||||||
.middlewares
|
.middlewares
|
||||||
.generate_function_middleware_chain(*i);
|
.generate_function_middleware_chain(i);
|
||||||
let mut reader =
|
let mut reader =
|
||||||
MiddlewareBinaryReader::new_with_offset(input.data, input.module_offset);
|
MiddlewareBinaryReader::new_with_offset(input.data, input.module_offset);
|
||||||
reader.set_middleware_chain(middleware_chain);
|
reader.set_middleware_chain(middleware_chain);
|
||||||
@ -107,7 +107,7 @@ impl Compiler for SinglepassCompiler {
|
|||||||
&vmoffsets,
|
&vmoffsets,
|
||||||
&memory_styles,
|
&memory_styles,
|
||||||
&table_styles,
|
&table_styles,
|
||||||
*i,
|
i,
|
||||||
&locals,
|
&locals,
|
||||||
)
|
)
|
||||||
.map_err(to_compile_error)?;
|
.map_err(to_compile_error)?;
|
||||||
@ -128,8 +128,7 @@ impl Compiler for SinglepassCompiler {
|
|||||||
.signatures
|
.signatures
|
||||||
.values()
|
.values()
|
||||||
.collect::<Vec<_>>()
|
.collect::<Vec<_>>()
|
||||||
.par_iter()
|
.into_par_iter()
|
||||||
.cloned()
|
|
||||||
.map(gen_std_trampoline)
|
.map(gen_std_trampoline)
|
||||||
.collect::<Vec<_>>()
|
.collect::<Vec<_>>()
|
||||||
.into_iter()
|
.into_iter()
|
||||||
@ -138,7 +137,7 @@ impl Compiler for SinglepassCompiler {
|
|||||||
let dynamic_function_trampolines = module
|
let dynamic_function_trampolines = module
|
||||||
.imported_function_types()
|
.imported_function_types()
|
||||||
.collect::<Vec<_>>()
|
.collect::<Vec<_>>()
|
||||||
.par_iter()
|
.into_par_iter()
|
||||||
.map(|func_type| gen_std_dynamic_import_trampoline(&vmoffsets, &func_type))
|
.map(|func_type| gen_std_dynamic_import_trampoline(&vmoffsets, &func_type))
|
||||||
.collect::<Vec<_>>()
|
.collect::<Vec<_>>()
|
||||||
.into_iter()
|
.into_iter()
|
||||||
|
Reference in New Issue
Block a user