pub struct WasmModule<'a> {Show 20 fields
pub functions: Vec<FunctionBody<'a>>,
pub func_types: Vec<FuncType>,
pub function_type_indices: Vec<u32>,
pub globals: Vec<GlobalType>,
pub global_init_values: Vec<i32>,
pub data_segments: Vec<DataSegment>,
pub memory_limits: MemoryLimits,
pub num_imported_funcs: u32,
pub imported_func_type_indices: Vec<u32>,
pub imported_func_names: Vec<String>,
pub main_func_local_idx: usize,
pub has_secondary_entry: bool,
pub secondary_entry_local_idx: Option<usize>,
pub start_func_local_idx: Option<usize>,
pub function_signatures: Vec<(usize, bool)>,
pub type_signatures: Vec<(usize, usize)>,
pub function_table: Vec<u32>,
pub exported_wasm_func_indices: Vec<u32>,
pub wasm_memory_base: i32,
pub max_memory_pages: u32,
}Expand description
Parsed and pre-processed WASM module, usable by both legacy and LLVM pipelines.
Fields§
§functions: Vec<FunctionBody<'a>>Function bodies from the code section.
func_types: Vec<FuncType>All function types declared in the type section.
function_type_indices: Vec<u32>Type index for each local function (parallels functions).
globals: Vec<GlobalType>Global variable types.
global_init_values: Vec<i32>Initial values of global variables.
data_segments: Vec<DataSegment>Active data segments from the data section.
memory_limits: MemoryLimitsMemory limits parsed from the memory section.
num_imported_funcs: u32Number of imported functions (precede local functions in global index space).
imported_func_type_indices: Vec<u32>Type indices for imported functions.
imported_func_names: Vec<String>Names of imported functions.
main_func_local_idx: usizeLocal function index of the main entry point.
has_secondary_entry: boolWhether the WASM module exports a “main2” secondary entry point.
secondary_entry_local_idx: Option<usize>Local function index of the secondary entry point (None if import or absent).
start_func_local_idx: Option<usize>Local function index of the start function (None if import or absent).
function_signatures: Vec<(usize, bool)>(num_params, has_return) for each function (imports first, then locals).
type_signatures: Vec<(usize, usize)>(num_params, num_results) for each type.
function_table: Vec<u32>Function table for indirect calls (u32::MAX = invalid entry).
exported_wasm_func_indices: Vec<u32>WASM global indices of all exported functions.
wasm_memory_base: i32Base address of WASM linear memory in PVM address space.
max_memory_pages: u32Maximum WASM memory pages available for memory.grow.