diff options
| author | Henry <mail@henrygressmann.de> | 2026-04-25 14:06:04 +0200 |
|---|---|---|
| committer | Henry <mail@henrygressmann.de> | 2026-04-25 14:06:04 +0200 |
| commit | 4d829a824834b470ada9981ab3ab2caa3e289378 (patch) | |
| tree | 962029814c19f14b5675acb5fee191abd2a43297 /crates/parser/src/module.rs | |
| parent | 19038bfea6a65e2aad89ec6a8fa51c41da35b219 (diff) | |
chore: reduce instantiation ovherhead & refactor optimize
Signed-off-by: Henry <mail@henrygressmann.de>
Diffstat (limited to 'crates/parser/src/module.rs')
| -rw-r--r-- | crates/parser/src/module.rs | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/crates/parser/src/module.rs b/crates/parser/src/module.rs index 164127f..548280e 100644 --- a/crates/parser/src/module.rs +++ b/crates/parser/src/module.rs @@ -200,17 +200,26 @@ impl ModuleReader { { let ty = self.func_types.get(ty_idx as usize).expect("No func type for func, this is a bug").clone(); let params = ValueCounts::from_iter(ty.params()); + let results = ValueCounts::from_iter(ty.results()); let self_func = (imported_func_count + func_idx) as u32; let local_mem_alloc = optimize_local_memory_allocation && local_memory_allocation != LocalMemoryAllocation::Eager; - let optimized = - optimize::optimize_instructions(instructions, &mut data, self_func, import_mem_count, local_mem_alloc); + let optimized = optimize::optimize_instructions( + instructions, + &mut data, + options, + self_func, + import_mem_count, + local_mem_alloc, + ); if optimized.uses_local_memory { local_memory_allocation = LocalMemoryAllocation::Eager; } - funcs.push(WasmFunction { instructions: optimized.instructions.into(), data, locals, params, ty }.into()); + funcs.push( + WasmFunction { instructions: optimized.instructions.into(), data, locals, params, results, ty }.into(), + ); } Ok(ModuleInner { |
