pub struct DecodedModule {
pub functions: Vec<FunctionOps>,
pub memories: Vec<WasmMemory>,
pub data_segments: Vec<(u32, Vec<u8>)>,
pub imports: Vec<ImportEntry>,
pub num_imported_funcs: u32,
pub func_arg_counts: Vec<u32>,
pub type_arg_counts: Vec<u32>,
pub globals: Vec<WasmGlobal>,
pub elem_func_indices: Vec<u32>,
}Expand description
Decoded WASM module with functions and memory
Fields§
§functions: Vec<FunctionOps>Decoded functions
memories: Vec<WasmMemory>Linear memories
data_segments: Vec<(u32, Vec<u8>)>Data segments (offset, data) for memory initialization
imports: Vec<ImportEntry>Import entries (module name, field name, kind)
num_imported_funcs: u32Number of imported functions (for distinguishing import calls from local calls)
func_arg_counts: Vec<u32>AAPCS integer-argument count per function, indexed by the full WASM
function index (imported functions first, then locally-defined ones).
Used by the backend to marshal call arguments into R0–R3 (issue #195).
Counts every parameter as one slot (i64/f64 over-counted — see the
backend’s set_func_arg_counts scope note).
type_arg_counts: Vec<u32>AAPCS integer-argument count per function type, indexed by type index.
Used by call_indirect, whose callee arg count comes from the static
type index (issue #195).
globals: Vec<WasmGlobal>Defined globals with their initializers (#237). Empty if the module has
no global section. Used by the native-pointer ABI to make a global whose
initializer is a linear-memory address (e.g. $__stack_pointer)
self-contained rather than table-relative.
elem_func_indices: Vec<u32>Function indices that populate any table via an element segment (#275).
These are the possible call_indirect targets — a function reached only
through the table is invisible to direct-call reachability, so the
whole-graph closure must treat every table entry as reachable once any
reachable function performs a call_indirect. Empty for modules with no
element section (every leaf/direct-call module), keeping output identical.
Trait Implementations§
Source§impl Clone for DecodedModule
impl Clone for DecodedModule
Source§fn clone(&self) -> DecodedModule
fn clone(&self) -> DecodedModule
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more