diff options
| author | Henry <mail@henrygressmann.de> | 2026-04-26 14:49:09 +0200 |
|---|---|---|
| committer | Henry <mail@henrygressmann.de> | 2026-04-26 14:49:09 +0200 |
| commit | 40bd20bb77b611f7974036c9f2b152a16a46c32a (patch) | |
| tree | c703b2fab3302b3ccbd7a202b9c2a9b3178ea49d /crates/parser/src/conversion.rs | |
| parent | cee820e5545c1fb9b423b915cf688414069cc960 (diff) | |
feat: multithreaded wasm parser
Signed-off-by: Henry <mail@henrygressmann.de>
Diffstat (limited to 'crates/parser/src/conversion.rs')
| -rw-r--r-- | crates/parser/src/conversion.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/parser/src/conversion.rs b/crates/parser/src/conversion.rs index f7fcb34..487f992 100644 --- a/crates/parser/src/conversion.rs +++ b/crates/parser/src/conversion.rs @@ -1,6 +1,6 @@ use alloc::sync::Arc; -use crate::{Result, module::Code, visit::process_operators_and_validate}; +use crate::{Result, module::FunctionCode, visit::process_operators_and_validate}; use alloc::{boxed::Box, format, string::ToString, vec::Vec}; use tinywasm_types::*; use wasmparser::{FuncValidator, FuncValidatorAllocations, OperatorsReader, ValidatorResources}; @@ -163,7 +163,7 @@ pub(crate) fn convert_module_export(export: wasmparser::Export<'_>) -> Result<Ex pub(crate) fn convert_module_code( func: wasmparser::FunctionBody<'_>, mut validator: FuncValidator<ValidatorResources>, -) -> Result<(Code, FuncValidatorAllocations)> { +) -> Result<(FunctionCode, FuncValidatorAllocations)> { let locals_reader = func.get_locals_reader()?; let count = locals_reader.get_count(); let pos = locals_reader.original_position(); @@ -200,7 +200,7 @@ pub(crate) fn convert_module_code( } let (body, data, allocations) = process_operators_and_validate(validator, func, local_addr_map)?; - Ok(((body, data, local_counts), allocations)) + Ok((FunctionCode { instructions: body, data, locals: local_counts, uses_local_memory: false }, allocations)) } pub(crate) fn convert_module_type(ty: wasmparser::RecGroup) -> Result<Arc<FuncType>> { |
