pub struct Store<'b> {
pub functions: Vec<FuncInst>,
pub memories: Vec<MemInst>,
pub globals: Vec<GlobalInst>,
pub data: Vec<DataInst>,
pub tables: Vec<TableInst>,
pub elements: Vec<ElemInst>,
pub modules: Vec<ModuleInst<'b>>,
pub module_names: BTreeMap<String, usize>,
}
Expand description
The store represents all global state that can be manipulated by WebAssembly programs. It consists of the runtime representation of all instances of functions, tables, memories, and globals, element segments, and data segments that have been allocated during the life time of the abstract machine. https://webassembly.github.io/spec/core/exec/runtime.html#store
Fields§
§functions: Vec<FuncInst>
§memories: Vec<MemInst>
§globals: Vec<GlobalInst>
§data: Vec<DataInst>
§tables: Vec<TableInst>
§elements: Vec<ElemInst>
§modules: Vec<ModuleInst<'b>>
§module_names: BTreeMap<String, usize>
Implementations§
Source§impl<'b> Store<'b>
impl<'b> Store<'b>
Sourcepub fn add_module(
&mut self,
name: &str,
validation_info: &ValidationInfo<'b>,
) -> CustomResult<()>
pub fn add_module( &mut self, name: &str, validation_info: &ValidationInfo<'b>, ) -> CustomResult<()>
instantiates a validated module with validation_info
as validation evidence with name name
with the steps in https://webassembly.github.io/spec/core/exec/modules.html#instantiation
this method roughly matches the suggested embedder functionmodule_instantiate
https://webassembly.github.io/spec/core/appendix/embedding.html#modules
except external values for module instantiation are retrieved from self
.
Sourcefn alloc_func(
&mut self,
func: (usize, (Span, usize)),
module_inst: &ModuleInst<'_>,
module_addr: usize,
) -> usize
fn alloc_func( &mut self, func: (usize, (Span, usize)), module_inst: &ModuleInst<'_>, module_addr: usize, ) -> usize
roughly matches https://webassembly.github.io/spec/core/exec/modules.html#functions with the addition of sidetable pointer to the input signature