wasmer_compiler_cranelift/debug/
address_map.rs

1//! Data structures to provide transformation of the source
2// addresses of a WebAssembly module into the native code.
3
4use cranelift_codegen::ir;
5use wasmer_types::entity::PrimaryMap;
6use wasmer_types::LocalFunctionIndex;
7
8/// Value ranges for functions.
9pub type ValueLabelsRanges = PrimaryMap<LocalFunctionIndex, cranelift_codegen::ValueLabelsRanges>;
10
11/// Stack slots for functions.
12pub type StackSlots = PrimaryMap<LocalFunctionIndex, ir::StackSlots>;
13
14/// Memory definition offset in the VMContext structure.
15#[derive(Debug, Clone)]
16pub enum ModuleInfoMemoryOffset {
17    /// Not available.
18    None,
19    /// Offset to the defined memory.
20    Defined(u32),
21    /// Offset to the imported memory.
22    Imported(u32),
23}
24
25/// ModuleInfo `vmctx` related info.
26#[derive(Debug, Clone)]
27pub struct ModuleInfoVmctxInfo {
28    /// The memory definition offset in the VMContext structure.
29    pub memory_offset: ModuleInfoMemoryOffset,
30
31    /// The functions stack slots.
32    pub stack_slots: StackSlots,
33}