improvement(compiler) More x86_64 speicific code removed from CodeGen

This commit is contained in:
ptitSeb
2021-12-06 15:38:07 +01:00
parent 5ed8fbfbcb
commit 517f81b302
5 changed files with 503 additions and 425 deletions

View File

@ -2,11 +2,11 @@
// Allow unused imports while developing.
#![allow(unused_imports, dead_code)]
use crate::codegen_x64::{
gen_import_call_trampoline, gen_std_dynamic_import_trampoline, gen_std_trampoline, FuncGen,
};
use crate::codegen_x64::FuncGen;
use crate::config::Singlepass;
use crate::machine::CodegenError;
use crate::machine::{
gen_import_call_trampoline, gen_std_dynamic_import_trampoline, gen_std_trampoline, CodegenError,
};
use loupe::MemoryUsage;
#[cfg(feature = "rayon")]
use rayon::prelude::{IntoParallelIterator, ParallelIterator};
@ -95,6 +95,7 @@ impl Compiler for SinglepassCompiler {
&vmoffsets,
i,
&module.signatures[module.functions[i]],
target,
calling_convention,
)
})
@ -153,7 +154,7 @@ impl Compiler for SinglepassCompiler {
.values()
.collect::<Vec<_>>()
.into_par_iter_if_rayon()
.map(|func_type| gen_std_trampoline(&func_type, calling_convention))
.map(|func_type| gen_std_trampoline(&func_type, target, calling_convention))
.collect::<Vec<_>>()
.into_iter()
.collect::<PrimaryMap<_, _>>();
@ -163,7 +164,12 @@ impl Compiler for SinglepassCompiler {
.collect::<Vec<_>>()
.into_par_iter_if_rayon()
.map(|func_type| {
gen_std_dynamic_import_trampoline(&vmoffsets, &func_type, calling_convention)
gen_std_dynamic_import_trampoline(
&vmoffsets,
&func_type,
target,
calling_convention,
)
})
.collect::<Vec<_>>()
.into_iter()