Releases: wasmi-labs/wasmi
Releases · wasmi-labs/wasmi
v0.25.0 - 2023-02-04
Added
- Added
Config::floats
option to enable or disable Wasm float operators during Wasm validation. Trap::downcast_mut
andTrap::downcast
methods. (#650)- This helps users to downcast into
T: HostError
.
- This helps users to downcast into
- Added
WasmType
impls forFuncRef
andExternRef
types. (#642)- This allows
FuncRef
andExternRef
instances to be used inTypedFunc
parameters and results.
- This allows
Removed
- Removed from
From
impls fromwasmparser-nostd
types towasmi
types.- For example
From<wasmparser::FuncType> for wasmi::FuncType
got removed.
- For example
Changed
- Update the
wasmparser-nostd
dependency from version0.91.0
to0.99.0
. (#640) - The
Trap
type is no longerClone
. (#650)
Internal
v0.24.0 - 2023-01-31
Added
- Added support for the
bulk-memory
Wasm proposal. (#628) - Added support for the
reference-types
Wasm proposal. (#635) - Added
ValueType::{is_ref, is_num
} methods. (#635) - Added
Value::{i32, i64, f32, f64, externref, funcref}
accessor methods toValue
.
Fixed
- Fix a bug with
Table
andMemory
imports not respecting the current size. (#635)- This sometimes led to the problem that valid
Table
andMemory
imports
could incorrectly be rejected for having an invalid size for the subtype check. - This has been fixed as part of the
reference-types
Wasm proposal implementation.
- This sometimes led to the problem that valid
Changed
- Use more references in places to provide the compiler with more optimization opportunities. (#634)
- This led to a speed-up across the board for Wasm targets of about 15-20%.
- Move the
Value
type fromwasmi_core
towasmi
. (#636)- This change was necessary in order to support the
reference-types
Wasm proposal.
- This change was necessary in order to support the
- There has been some consequences from implementing the
reference-types
Wasm proposal which are listed below:- The
Value
type no longer implementsCopy
andPartialEq
. - The
From<&Value> for UntypedValue
impl has been removed. - Remove some
From
impls forValue
. - Moved some
Display
impls for types likeFuncType
andValue
to thewasmi_cli
crate. - Remove the
try_into
API from theValue
type.- Users should use the new accessor methods as in the Wasmtime API.
- The
Internal
- Update
wast
dependency from version0.44
to0.52
. (#632) - Update the Wasm spec testsuite to the most recent commit:
3a04b2cf9
- Improve error reporting for the internal Wasm spec testsuite runner.
- It will now show proper span information in many more cases.
v0.23.0 - 2023-01-19
Note: This is the Wasmtime API Compatibility update.
Added
- Add
Module::get_export
method. (#617)
Changed
- Removed
ModuleError
export from crate root. (#618)- Now
ModuleError
is exported fromcrate::errors
just like all the other error types.
- Now
- Refactor and cleanup traits underlying to
IntoFunc
. (#620)- This is only the first step in moving closer to the Wasmtime API traits.
- Mirror Wasmtime API more closely. (#615, #616)
- Renamed
Caller::host_data
method toCaller::data
. - Renamed
Caller::host_data_mut
method toCaller::data_mut
. - Add
Extern::ty
method and theExternType
type. - Rename
ExportItem
toExportType
:- Rename the
ExportItem::kind
method toty
and returnExternType
instead ofExportItemKind
. - Remove the no longer used
ExportItemKind
entirely.
- Rename the
- The
ExportsIter
now yields items of the new typeExport
instead of pairs of(&str, Extern)
. - Rename
ModuleImport
toImportType
.- Rename
ImportType::item_type
toty
. - Rename
ImportType::field
toname
. - Properly forward
&str
lifetimes inImportType::{module, name}
. - Replace
ModuleImportType
byExternType
.
- Rename
- Add new convenience methods to
Instance
:Instance::get_func
Instance::get_typed_func
Instance::get_global
Instance::get_table
Instance::get_memory
- Rename getters for querying types of runtime objects:
Func::func_type
=>Func::ty
Global::global_type
=>Global::ty
Table::table_type
=>Table::ty
Memory::memory_type
=>Memory::ty
Value::value_type
=>Value::ty
- Remove
Global::value_type
getter.- Use
global.ty().content()
instead.
- Use
- Remove
Global::is_mutable
getter.- Use
global.ty().mutability().is_mut()
instead.
- Use
- Rename
Mutability::Mutable
toVar
. - Add
Mutability::is_mut
getter.- While this API is not included in Wasmtime it is a useful convenience method.
- Rename
TableType::initial
method tominimum
. - Rename
Table::len
method tosize
. Table
andTableType
now operate onu32
instead ofusize
just like in Wasmtime.- This affects
Table::{new, size, set, get, grow}
methods andTableType::{new, minimum, maximum}
methods and their users.
- This affects
- Renamed
v0.22.0 - 2023-01-16
Added
- Add missing
TypedFunc::call_resumable
API. (#605)- So far resumable calls were only available for the
Func
type.
However, there was no technical reason why it was not implemented
forTypedFunc
so this mirrored API now exists. - This also cleans up rough edges with the
Func::call_resumable
API.
- So far resumable calls were only available for the
Changed
- Clean up the
wasmi_core
crate API. (#607, #608, #609)- This removes plenty of traits from the public interface of the crate
which greatly simplifies the API surface for users. - The
UntypedValue
type gained some new methods to replace functionality
that was provided in parts by the removed traits.
- This removes plenty of traits from the public interface of the crate
- The
wasmi
crate now follows the Wasmtime API a bit more closely. (#613)StoreContext
new methods:fn engine(&self) -> &Engine
fn data(&self) -> &T
StoreContextMut
new methods:fn engine(&self) -> &Engine
fn data(&self) -> &T
fn data_mut(&mut self) -> &mut T
- Renamed
Store::state
method toStore::data
. - Renamed
Store::state_mut
method toStore::data_mut
. - Renamed
Store::into_state
method toStore::into_data
.
Internal
v0.21.0 - 2023-01-04
Added
- Add support for resumable function calls. (#598)
- This feature allows to resume a function call upon encountering a host trap.
- Add support for concurrently running function executions using a single
wasmi
engine.- This feature also allows to call Wasm functions from host functions. (#590)
- Add initial naive WASI support for
wasmi
using the newwasmi_wasi
crate. (#557)- Special thanks to Onigbinde Oluwamuyiwa Elijah for carrying the WASI support efforts!
- Also thanks to Yuyi Wang for testing and improving initial WASI support. (#592, #571, #568)
- Note: There is ongoing work to integrate WASI support in
wasmi_cli
so that thewasmi
CLI will then
be able to execute arbitrarywasm-wasi
files out of the box in the future.
- Add
Module::imports
that allows to query Wasm module imports. (#573, #583)
Fixed
- Fix a bug that imported linear memories and tables were initialized twice upon instantiation. (#593)
- The
wasmi
CLI now properly hints for file path arguments. (#596)
Changed
- The
wasmi::Trap
type is now more similar to Wasmtime'sTrap
type. (#559) - The
wasmi::Store
type is nowSend
andSync
as intended. (#566) - The
wasmi
CLI now prints exported functions names if the function name CLI argument is missing. (#579) - Improve feedback when running a Wasm module without exported function using
wasmi
CLI. (#584)
v0.20.0 - 2022-11-04
Added
- Added contribution documentation about fuzz testing. (#529)
Removed
- Removed some deprecated functions in the
wasmi_core
crate. (#545)
Fixed
- Fixed a critical performance regression introduced in Rust 1.65. (#518)
- While the PR's main job was to clean up some code it was found out that it
also fixes a critical performance regression introduced in Rust 1.65. - You can read more about this performance regression in this thread.
- While the PR's main job was to clean up some code it was found out that it
Changed
- Fixed handling of edge cases with respect to Wasm linear memory. (#449)
- This allows for
wasmi
to properly setup and use linear memory instances of up to 4GB.
- This allows for
- Optimize and improve Wasm instantiation. (#531)
- Optimize
global.get
of immutable non-imported globals. (#533)- Also added a benchmark test for this. (#532)
Internal
v0.19.0 - 2022-10-20
Fixed
- Fixed a potential undefined behavior as reported by the
miri
tool
with respect to its experimental stacked borrows. (#524)
Changed
- Optimized Wasm to
wasmi
translation phase by removing unnecessary Wasm
validation type checks. (#527)- Speedups were in the range of 15%.
Linker::instantiate
now takes&self
instead of&mut self
. (#512)- This allows users to easily predefine a linker and reused its definitions
as shared resource.
- This allows users to easily predefine a linker and reused its definitions
- Fixed a bug were
Caller::new
was public. (#514)- It is now a private method as it was meant to be.
- Optimized
TypedFunc::call
at slight cost ofFunc::call
. (#522)- For many parameters and return values the measured improvements are in the range of 25%.
Note that this is only significant for a large amount of host to Wasm calls of small functions.
- For many parameters and return values the measured improvements are in the range of 25%.
Internal
v0.18.1 - 2022-10-13
Changed
- Optimize for common cases for branch and return instructions.
(#493)- This led to up to 10% performance improvement according to our benchmarks
in some cases.
- This led to up to 10% performance improvement according to our benchmarks
- Removed extraneous
S: impl AsContext
generic parameter fromFunc::typed
method. - Make
IntoFunc
,WasmType
andWasmRet
traits publicly available. - Add missing impl for
WasmRet
forResult<T, Trap> where T: WasmType
.- Without this impl it was impossible to provide closures to
Func::wrap
that returnedResult<T, Trap>
whereT: WasmType
, onlyResult<(), Trap>
orResult<(T,), Trap>
was possible before.
- Without this impl it was impossible to provide closures to
Internal
v0.18.0 - 2022-10-02
Added
- Added Contibution Guidelines and Code of Conduct to the repository. (#485)
Changed
- Optimized instruction dispatch in the
wasmi
interpreter.
(#478, #482)- This yielded combined speed-ups of ~20% across the board.
- As a side effect we also refactored the way we compute branching offsets
at Wasm module compilation time which improved performance of Wasm module
compilation by roughly 5%.
Internal
v0.17.0 - 2022-09-23
Added
- Added
Memory::data_and_store_mut
API inspired by Wasmtime's API. (#462)
Changed
- Updated
wasmparser-nostd
dependency from0.90.0
to0.91.0
.- This improved performance of Wasm module compilation by ~10%.
- Updated
wasmi_core
from0.3.0
to0.4.0
. - Optimized execution of several Wasm float to int conversion instructions. (#439)
- We measured a performance improvement of 6000% or in other words those
instructions are now 60 times faster than before. - This allowed us to remove the big
num-rational
dependency fromwasmi_core
for some nice speed-ups in compilation time ofwasmi
itself.
- We measured a performance improvement of 6000% or in other words those
- Optimized
global.get
andglobal.set
Wasm instruction execution. (#427)- This improved performance of those instructions by up to 17%.
- Optimized Wasm value stack emulation. (#459)
- This improved performance of compute intense workloads by up to 23%.
Internal
- Added automated continuous benchmarking to
wasmi
. (#422)- This allows us to have a more consistent overview over the performance of
wasmi
.
- This allows us to have a more consistent overview over the performance of
- Updated
criterion
benchmarking framework to version0.4.0
. - Reuse allocations during Wasm validation and translation:
- Enabled more useful
clippy
lints forwasmi
andwasmi_core
. (#438) - Reorganized the
wasmi
workspace. (#466)