Remove the local field of Module (#2091)

This was added long ago at this point to assist with caching, but
caching has moved to a different level such that this wonky second level
of a `Module` isn't necessary. This commit removes the `ModuleLocal`
type to simplify accessors and generally make it easier to work with.
This commit is contained in:
Alex Crichton
2020-08-04 12:29:16 -05:00
committed by GitHub
parent c21fe0eb73
commit 3d2e0e55f2
26 changed files with 131 additions and 164 deletions

View File

@@ -256,7 +256,6 @@ impl CompiledModule {
// Compute indices into the shared signature table.
let signatures = {
self.module
.local
.signatures
.values()
.map(|(wasm_sig, native)| {
@@ -387,7 +386,7 @@ fn create_dbg_image(
.values()
.map(|allocated: &*mut [VMFunctionBody]| (*allocated) as *const u8)
.collect::<Vec<_>>();
create_gdbjit_image(obj, code_range, module.local.num_imported_funcs, &funcs)
create_gdbjit_image(obj, code_range, module.num_imported_funcs, &funcs)
.map_err(SetupError::DebugInfo)
}
@@ -417,7 +416,7 @@ fn build_code_memory(
let fat_ptr: *mut [VMFunctionBody] = fat_ptr;
assert_eq!(
Some(finished_functions.push(fat_ptr)),
module.local.defined_func_index(i)
module.defined_func_index(i)
);
}