diff --git a/CHANGELOG.md b/CHANGELOG.md index c4f0441098..27cb77423c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,53 @@ Additionally we have an `Internal` section for changes that are of interest to d Dates in this file are formattes as `YYYY-MM-DD`. +## [`0.37.0`] - 2024-30-09 + +### Added + +- Added support for Wasm `multi-value` proposal. [#1191] +- Added `Store::call_hook` API. [#1144] + - Contributed by [emiltayl](https://github.com/emiltayl). + +### Changed + +- Updated WASI dependencies. [#1140] + - This fixes some long-standing bugs in the `wasmi_wasi` crate. + +### Fixed + +- This release includes all fixes that have been backported to `v0.36.1` and `v0.36.2`. + +### Internal + +- Add new Wasmi bytecode. [#1152] + - This was a major undertaking with lots of sub-issues and PRs. + - The Wasmi bytecode definitions now reside in their own [`wasmi_ir` crate]. + - Most of the definitions are sourced from a single Rust macro to reduce maintenance friction. +- Remove unnecessary `iextend` instructions. [#1147] +- Changed encoding for Wasmi `call_indirect` instructions. [#1156] + - The new encoding improves performance and reduces the number of function local constants. +- Changed encoding for Wasmi `select` instructions. [#1157] + - The new encoding is more straight-forward and aims to simplify the Wasmi executor and translator. +- Changed encoding for Wasmi `br_table` instruction. [#1158] + - The new encoding improves performance and memory consumption for certain use cases. +- Minor improvements to Wasmi bytecode. + - `MemoryGrowBy` now takes `u32` delta. [#1193] + - Improved `storeN` encoding with immediates. [#1194] + +[#1144]: https://github.com/wasmi-labs/wasmi/pull/1144 +[#1147]: https://github.com/wasmi-labs/wasmi/pull/1147 +[#1140]: https://github.com/wasmi-labs/wasmi/pull/1140 +[#1152]: https://github.com/wasmi-labs/wasmi/pull/1152 +[#1156]: https://github.com/wasmi-labs/wasmi/pull/1156 +[#1157]: https://github.com/wasmi-labs/wasmi/pull/1157 +[#1158]: https://github.com/wasmi-labs/wasmi/pull/1158 +[#1191]: https://github.com/wasmi-labs/wasmi/pull/1191 +[#1193]: https://github.com/wasmi-labs/wasmi/pull/1193 +[#1194]: https://github.com/wasmi-labs/wasmi/pull/1194 + +[`wasmi_ir` crate]: https://crates.io/crates/wasmi_ir + ## [`0.36.2`] - 2024-28-09 ### Fixed diff --git a/Cargo.lock b/Cargo.lock index 2d729185de..6bce3a2eed 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1839,7 +1839,7 @@ dependencies = [ [[package]] name = "wasmi" -version = "0.36.0" +version = "0.37.0" dependencies = [ "anyhow", "arrayvec", @@ -1849,7 +1849,7 @@ dependencies = [ "smallvec", "spin", "wasmi_collections", - "wasmi_core 0.36.0", + "wasmi_core 0.37.0", "wasmi_ir", "wasmparser-nostd", "wast 70.0.2", @@ -1864,22 +1864,22 @@ checksum = "104a7f73be44570cac297b3035d76b169d6599637631cf37a1703326a0727073" [[package]] name = "wasmi_c_api" -version = "0.36.0" +version = "0.37.0" dependencies = [ "wasmi_c_api_impl", ] [[package]] name = "wasmi_c_api_impl" -version = "0.36.0" +version = "0.37.0" dependencies = [ - "wasmi 0.36.0", + "wasmi 0.37.0", "wasmi_c_api_macros", ] [[package]] name = "wasmi_c_api_macros" -version = "0.36.0" +version = "0.37.0" dependencies = [ "proc-macro2", "quote", @@ -1887,19 +1887,19 @@ dependencies = [ [[package]] name = "wasmi_cli" -version = "0.36.0" +version = "0.37.0" dependencies = [ "anyhow", "assert_cmd", "clap", - "wasmi 0.36.0", + "wasmi 0.37.0", "wasmi_wasi", "wat", ] [[package]] name = "wasmi_collections" -version = "0.36.0" +version = "0.37.0" dependencies = [ "ahash", "hashbrown 0.14.5", @@ -1920,7 +1920,7 @@ dependencies = [ [[package]] name = "wasmi_core" -version = "0.36.0" +version = "0.37.0" dependencies = [ "downcast-rs", "libm", @@ -1937,23 +1937,23 @@ dependencies = [ "libfuzzer-sys", "wasm-smith", "wasmi 0.31.2", - "wasmi 0.36.0", + "wasmi 0.37.0", "wasmtime", ] [[package]] name = "wasmi_ir" -version = "0.36.0" +version = "0.37.0" dependencies = [ - "wasmi_core 0.36.0", + "wasmi_core 0.37.0", ] [[package]] name = "wasmi_wasi" -version = "0.36.0" +version = "0.37.0" dependencies = [ "wasi-common", - "wasmi 0.36.0", + "wasmi 0.37.0", "wat", "wiggle", ] diff --git a/Cargo.toml b/Cargo.toml index ba8578b476..5e1846a3c4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ resolver = "2" [workspace.package] authors = ["Robin Freyler "] repository = "https://github.com/wasmi-labs/wasmi" -version = "0.36.0" +version = "0.37.0" rust-version = "1.79" edition = "2021" readme = "README.md" @@ -26,13 +26,13 @@ categories = ["wasm", "no-std", "virtualization"] exclude = ["tests"] [workspace.dependencies] -wasmi = { version = "0.36.0", path = "crates/wasmi", default-features = false } -wasmi_wasi = { version = "0.36.0", path = "crates/wasi", default-features = false } -wasmi_core = { version = "0.36.0", path = "crates/core", default-features = false } -wasmi_ir = { version = "0.36.0", path = "crates/ir", default-features = false } -wasmi_collections = { version = "0.36.0", path = "crates/collections", default-features = false } -wasmi_c_api_impl = { version = "0.36.0", path = "crates/c_api" } -wasmi_c_api_macros = { version = "0.36.0", path = "crates/c_api/macro" } +wasmi = { version = "0.37.0", path = "crates/wasmi", default-features = false } +wasmi_wasi = { version = "0.37.0", path = "crates/wasi", default-features = false } +wasmi_core = { version = "0.37.0", path = "crates/core", default-features = false } +wasmi_ir = { version = "0.37.0", path = "crates/ir", default-features = false } +wasmi_collections = { version = "0.37.0", path = "crates/collections", default-features = false } +wasmi_c_api_impl = { version = "0.37.0", path = "crates/c_api" } +wasmi_c_api_macros = { version = "0.37.0", path = "crates/c_api/macro" } num-traits = { version = "0.2.8", default-features = false } [profile.bench] diff --git a/README.md b/README.md index 8039e15ab7..1cc335d8a9 100644 --- a/README.md +++ b/README.md @@ -50,16 +50,16 @@ The new Wasmi engine supports a variety of WebAssembly proposals and will suppor | WebAssembly Proposal | Status | Comment | |:--|:--:|:--| -| [`mutable-global`] | ✅ | Since version `0.14.0`. | -| [`saturating-float-to-int`] | ✅ | Since version `0.14.0`. | -| [`sign-extension`] | ✅ | Since version `0.14.0`. | -| [`multi-value`] | ✅ | Since version `0.14.0`. | -| [`bulk-memory`] | ✅ | Since version `0.24.0`. [(#628)] | -| [`reference-types`] | ✅ | Since version `0.24.0`. [(#635)] | +| [`mutable-global`] | ✅ | ≥ `0.14.0`. | +| [`saturating-float-to-int`] | ✅ | ≥ `0.14.0`. | +| [`sign-extension`] | ✅ | ≥ `0.14.0`. | +| [`multi-value`] | ✅ | ≥ `0.14.0`. | +| [`bulk-memory`] | ✅ | ≥ `0.24.0`. [(#628)] | +| [`reference-types`] | ✅ | ≥ `0.24.0`. [(#635)] | | [`simd`] | ❌ | Unlikely to be supported. | -| [`tail-calls`] | ✅ | Since version `0.28.0`. [(#683)] | -| [`extended-const`] | ✅ | Since version `0.29.0`. [(#707)] | -| [`multi-memory`] | ✅ | Implemented but not yet released. Use `main` branch. | +| [`tail-calls`] | ✅ | ≥ `0.28.0`. [(#683)] | +| [`extended-const`] | ✅ | ≥ `0.29.0`. [(#707)] | +| [`multi-memory`] | ✅ | ≥ `0.37.0`. [(#1191)] | | [`function-references`] | 📅 | Planned but not yet implemented. [(#774)] | | [`gc`] | 📅 | Planned but not yet implemented. [(#775)] | | [`threads`] | 📅 | Planned but not yet implemented. [(#777)] | @@ -112,6 +112,7 @@ The new Wasmi engine supports a variety of WebAssembly proposals and will suppor [(#1036)]: https://github.com/wasmi-labs/wasmi/issues/1136 [(#1037)]: https://github.com/wasmi-labs/wasmi/issues/1137 [(#1197)]: https://github.com/wasmi-labs/wasmi/issues/1197 +[(#1191)]: https://github.com/wasmi-labs/wasmi/issues/1191 ## Development diff --git a/crates/ir/src/enum.rs b/crates/ir/src/enum.rs index e4838389b1..15e225c021 100644 --- a/crates/ir/src/enum.rs +++ b/crates/ir/src/enum.rs @@ -23,17 +23,19 @@ macro_rules! define_enum { ) => { /// A Wasmi instruction. /// - /// Actually Wasmi instructions are composed of so-called instruction words. - /// In fact this type represents single instruction words but for simplicity - /// we call the type [`Instruction`] still. - /// Most instructions are composed of a single instruction words. An example of - /// this is [`Instruction::I32Add`]. However, some instructions like - /// [`Instruction::Select`] are composed of two or more instruction words. - /// The Wasmi bytecode translation phase makes sure that those instruction words - /// always appear in valid sequences. The Wasmi executor relies on this guarantee. - /// The documentation of each [`Instruction`] variant describes its encoding in the + /// Wasmi instructions are composed of so-called instruction words. + /// This type represents all such words and for simplicity we call the type [`Instruction`], still. + /// + /// Most instructions are composed of a single instruction word. An example of + /// this is [`Instruction::I32Add`]. However, some instructions, like + /// [`Instruction::Select`], are composed of two or more instruction words. + /// + /// The Wasmi bytecode translation makes sure that instructions always appear in valid sequences. + /// The Wasmi executor relies on the guarantees that the Wasmi translator provides. + /// + /// The documentation of each [`Instruction`] describes its encoding in the /// `#Encoding` section of its documentation if it requires more than a single - /// instruction word for its encoding. + /// instruction for its encoding. #[derive(Debug, Copy, Clone, PartialEq, Eq)] #[repr(u16)] pub enum Instruction {