Remove the stack map registry.
This commit removes the stack map registry and instead uses the existing information from the store's module registry to lookup stack maps. A trait is now used to pass the lookup context to the runtime, implemented by `Store` to do the lookup. With this change, module registration in `Store` is now entirely limited to inserting the module into the module registry.
This commit is contained in:
@@ -362,11 +362,18 @@ impl CompiledModule {
|
||||
}
|
||||
|
||||
/// Gets the function information for a given function index.
|
||||
pub fn func_info(&self, index: DefinedFuncIndex) -> (&FunctionAddressMap, &[TrapInformation]) {
|
||||
pub fn func_info(
|
||||
&self,
|
||||
index: DefinedFuncIndex,
|
||||
) -> (
|
||||
&FunctionAddressMap,
|
||||
&[TrapInformation],
|
||||
&[StackMapInformation],
|
||||
) {
|
||||
self.artifacts
|
||||
.funcs
|
||||
.get(index)
|
||||
.map(|f| (&f.address_map, f.traps.as_ref()))
|
||||
.map(|f| (&f.address_map, f.traps.as_ref(), f.stack_maps.as_ref()))
|
||||
.expect("defined function should be present")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user