Move native signatures out of Module (#2362)
After compilation there's actually no need to hold onto the native signature for a wasm function type, so this commit moves out the `ir::Signature` value from a `Module` into a separate field that's deallocated when compilation is finished. This simplifies the `SignatureRegistry` because it only needs to track wasm functino types and it also means less work is done for `Func::wrap`.
This commit is contained in:
@@ -362,12 +362,18 @@ impl Compiler for Cranelift {
|
||||
let func_index = module.func_index(func_index);
|
||||
let mut context = Context::new();
|
||||
context.func.name = get_func_name(func_index);
|
||||
context.func.signature = module.native_func_signature(func_index).clone();
|
||||
let sig_index = module.functions[func_index];
|
||||
context.func.signature = translation.native_signatures[sig_index].clone();
|
||||
if tunables.debug_info {
|
||||
context.func.collect_debug_info();
|
||||
}
|
||||
|
||||
let mut func_env = FuncEnvironment::new(isa.frontend_config(), module, tunables);
|
||||
let mut func_env = FuncEnvironment::new(
|
||||
isa.frontend_config(),
|
||||
module,
|
||||
&translation.native_signatures,
|
||||
tunables,
|
||||
);
|
||||
|
||||
// We use these as constant offsets below in
|
||||
// `stack_limit_from_arguments`, so assert their values here. This
|
||||
|
||||
Reference in New Issue
Block a user