Don't return CodeInfo from Context::compile_and_emit

It is already available through ctx.mach_compile_result and rarely
needed.
This commit is contained in:
bjorn3
2022-01-04 15:48:05 +01:00
parent dd85d66ec3
commit b3aa692a44
5 changed files with 20 additions and 23 deletions

View File

@@ -652,11 +652,6 @@ impl Module for JITModule {
stack_map_sink: &mut dyn StackMapSink,
) -> ModuleResult<ModuleCompiledFunction> {
info!("defining function {}: {}", id, ctx.func.display());
let CodeInfo {
total_size: code_size,
..
} = ctx.compile(self.isa())?;
let decl = self.declarations.get_function_decl(id);
if !decl.linkage.is_definable() {
return Err(ModuleError::InvalidImportDefinition(decl.name.clone()));
@@ -666,6 +661,11 @@ impl Module for JITModule {
return Err(ModuleError::DuplicateDefinition(decl.name.to_owned()));
}
let CodeInfo {
total_size: code_size,
..
} = ctx.compile(self.isa())?;
let size = code_size as usize;
let ptr = self
.memory