Skip to content

Commit 40e7660

Browse files
Release 0.9.0-alpha.0
tinywasm@0.9.0-alpha.0 tinywasm-cli@0.9.0-alpha.0 tinywasm-parser@0.9.0-alpha.0 tinywasm-types@0.9.0-alpha.0 wasm-testsuite@0.6.0-alpha.0 Generated by cargo-workspaces
1 parent c00031a commit 40e7660

File tree

16 files changed

+407
-196
lines changed

16 files changed

+407
-196
lines changed

Cargo.lock

Lines changed: 22 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ default-members=[".", "crates/tinywasm", "crates/types", "crates/parser"]
44
resolver="2"
55

66
[workspace.dependencies]
7-
wast="218"
8-
wat="1.218"
7+
wast="219"
8+
wat="1.219"
99
eyre="0.6"
1010
log="0.4"
1111
pretty_env_logger="0.5"
1212
criterion={version="0.5", default-features=false, features=["cargo_bench_support", "rayon"]}
1313

1414
[workspace.package]
15-
version="0.8.0"
15+
version="0.9.0-alpha.0"
1616
rust-version="1.81"
1717
edition="2021"
1818
license="MIT OR Apache-2.0"

crates/cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ path="src/bin.rs"
1515
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1616

1717
[dependencies]
18-
tinywasm={version="0.8.0-alpha.0", path="../tinywasm", features=["std", "parser"]}
18+
tinywasm={version="0.9.0-alpha.0", path="../tinywasm", features=["std", "parser"]}
1919
argh="0.1"
2020
eyre={workspace=true}
2121
log={workspace=true}

crates/parser/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ repository.workspace=true
99
rust-version.workspace=true
1010

1111
[dependencies]
12-
wasmparser={version="0.218", default-features=false, features=["validate", "features"]}
12+
wasmparser={version="0.219", default-features=false, features=["validate", "features"]}
1313
log={workspace=true, optional=true}
14-
tinywasm-types={version="0.8.0-alpha.0", path="../types", default-features=false}
14+
tinywasm-types={version="0.9.0-alpha.0", path="../types", default-features=false}
1515

1616
[features]
1717
default=["std", "logging"]

crates/parser/src/conversion.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ pub(crate) fn convert_module_code(
203203
}
204204
}
205205

206-
let (body, allocations) = process_operators_and_validate(validator, func, local_addr_map)?;
207-
Ok(((body, local_counts), allocations))
206+
let (body, data, allocations) = process_operators_and_validate(validator, func, local_addr_map)?;
207+
Ok(((body, data, local_counts), allocations))
208208
}
209209

210210
pub(crate) fn convert_module_type(ty: wasmparser::RecGroup) -> Result<FuncType> {

crates/parser/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,11 @@ impl Parser {
6161
function_references: true,
6262
tail_call: true,
6363
multi_memory: true,
64-
memory64: false,
6564
simd: true,
65+
memory64: true,
6666
custom_page_sizes: true,
6767

68+
wide_arithmetic: false,
6869
gc_types: true,
6970
stack_switching: false,
7071
component_model: false,

crates/parser/src/module.rs

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ use crate::{conversion, ParseError, Result};
33
use alloc::string::ToString;
44
use alloc::{boxed::Box, format, vec::Vec};
55
use tinywasm_types::{
6-
Data, Element, Export, FuncType, Global, Import, Instruction, MemoryType, TableType, TinyWasmModule, ValType,
7-
ValueCounts, ValueCountsSmall, WasmFunction,
6+
Data, Element, Export, FuncType, Global, Import, Instruction, MemoryType, TableType, TinyWasmModule, ValueCounts,
7+
ValueCountsSmall, WasmFunction, WasmFunctionData,
88
};
99
use wasmparser::{FuncValidatorAllocations, Payload, Validator};
1010

11-
pub(crate) type Code = (Box<[Instruction]>, ValueCounts);
11+
pub(crate) type Code = (Box<[Instruction]>, WasmFunctionData, ValueCounts);
1212

1313
#[derive(Default)]
1414
pub(crate) struct ModuleReader {
@@ -179,7 +179,6 @@ impl ModuleReader {
179179
Ok(())
180180
}
181181

182-
#[inline]
183182
pub(crate) fn into_module(self) -> Result<TinyWasmModule> {
184183
if !self.end_reached {
185184
return Err(ParseError::EndNotReached);
@@ -193,18 +192,10 @@ impl ModuleReader {
193192
.code
194193
.into_iter()
195194
.zip(self.code_type_addrs)
196-
.map(|((instructions, locals), ty_idx)| {
197-
let mut params = ValueCountsSmall::default();
195+
.map(|((instructions, data, locals), ty_idx)| {
198196
let ty = self.func_types.get(ty_idx as usize).expect("No func type for func, this is a bug").clone();
199-
for param in &ty.params {
200-
match param {
201-
ValType::I32 | ValType::F32 => params.c32 += 1,
202-
ValType::I64 | ValType::F64 => params.c64 += 1,
203-
ValType::V128 => params.c128 += 1,
204-
ValType::RefExtern | ValType::RefFunc => params.cref += 1,
205-
}
206-
}
207-
WasmFunction { instructions, locals, params, ty }
197+
let params = ValueCountsSmall::from(&ty.params);
198+
WasmFunction { instructions, data, locals, params, ty }
208199
})
209200
.collect::<Vec<_>>()
210201
.into_boxed_slice();

0 commit comments

Comments
 (0)