|
Revision tags: dev, v36.0.9, v44.0.1, v43.0.2, v36.0.8, v24.0.8, v44.0.0, v43.0.1, v42.0.2, v36.0.7, v24.0.7, v43.0.0, v42.0.1, v41.0.4, v42.0.0, v40.0.4, v36.0.6, v24.0.6, v41.0.3, v41.0.2, v41.0.1, v36.0.5, v40.0.3, v41.0.0, v36.0.4, v39.0.2, v40.0.2, v40.0.1, v40.0.0 |
|
| #
05a711f6 |
| 11-Dec-2025 |
Alex Crichton <[email protected]> |
Deduplicate static/dynamic host function code paths (#12146)
* Deduplicate static/dynamic host function code paths
This commit refactors the `component/func/host.rs` file to deduplicate the paths b
Deduplicate static/dynamic host function code paths (#12146)
* Deduplicate static/dynamic host function code paths
This commit refactors the `component/func/host.rs` file to deduplicate the paths between static/dynamic host functions. Previously there was a significant amount of duplication between the two which has been exacerbated through time. This commit refactors the state of affairs to ensure that all the shared logic between the two is in one location and the only difference is what they're already doing different (e.g. lifting/lowering guts).
The high-level goal here was to see if this was possible, but in the end this feels like a much cleaner state of affairs than prior as far fewer details are duplicated across a few locations. The host function behavior is slightly more "dynamic" than before in the sense that statically-known signature has a few more type lookups than before, for example, but this can be fixed in due time if necessary.
* Fix compile warnings/issues
show more ...
|
|
Revision tags: v39.0.1, v39.0.0, v38.0.4, v37.0.3, v36.0.3, v24.0.5, v38.0.3, v38.0.2, v38.0.1, v37.0.2, v37.0.1, v37.0.0, v36.0.2, v36.0.1, v36.0.0 |
|
| #
0f457fad |
| 25-Jul-2025 |
Alex Crichton <[email protected]> |
Raise `unsafe_op_in_unsafe_fn` further in Wasmtime (#11322)
* Raise `unsafe_op_in_unsafe_fn` further in Wasmtime
Now it's at `wasmtime::runtime`, not just `wasmtime::runtime::vm`.
* Review comments
|
|
Revision tags: v35.0.0, v24.0.4, v33.0.2, v34.0.2 |
|
| #
b221fca7 |
| 03-Jul-2025 |
Joel Dice <[email protected]> |
update `component-model-async` plumbing (#11123)
* [DO NOT MERGE] update `component-model-async` plumbing
This pulls in the latest Component Model async ABI code from the `wasip3-prototyping` repo,
update `component-model-async` plumbing (#11123)
* [DO NOT MERGE] update `component-model-async` plumbing
This pulls in the latest Component Model async ABI code from the `wasip3-prototyping` repo, including various API refactors and spec updates.
This includes all the changes to the `wasmtime` crate from `wasip3-prototyping` _except_ that the `concurrent` submodule and child submodules contain only non-functional stubs. For that reason, and the fact that e.g. `Func::call_async` is now implemented in terms of `Func::call_concurrent`, most of the component model tests are failing. This commit is not meant to be merged as-is; a follow-up commit (to be PR'd separately) will contain the real `concurrent` implementation, at which point the tests will pass again. I'm splitting these into separate PRs to make review easier.
Signed-off-by: Joel Dice <[email protected]>
* Undo wit-bindgen changes
No longer necessary after other refactors
* Move back to crates.io-based wit-bindgen
* Undo upgrade of http-body-util
(deferred for future PR)
* Add back in arbitrary use of async
Looks like it may have been lost by accident
* Make imports more conventional for Wasmtime
* Some minor changes
* Privatize a component field
* Cut down a bit on #[cfg]
* Undo a no-longer-necessary `pub`
* add doc comments for `{Future,Stream,ErrorContext}Any`
Signed-off-by: Joel Dice <[email protected]>
* rename `concurrent` stub module to `concurrent_disabled`
...and avoid panicking in the stubs.
Signed-off-by: Joel Dice <[email protected]>
* fix test regression
Signed-off-by: Joel Dice <[email protected]>
* revert `call_async` and `post_return_impl` changes
These will need to wait until the `component-model-async` feature is fully implemented.
Signed-off-by: Joel Dice <[email protected]>
* remove unused struct
Signed-off-by: Joel Dice <[email protected]>
* add `Options::callback` field
This isn't used yet, but will be used when the real `component-model-async` implementation is merged.
Signed-off-by: Joel Dice <[email protected]>
* Remove no-longer-needed feature
* Trim reexports from Wasmtime
Some of these are no longer needed or can be avoided with small changes. Some deps are likely needed in the next commit but they'll be best added there.
* Update test expectations
* More trimming of Cargo.toml
* Defer `*Buffer` traits to next PR
Not needed for this PR I believe.
* Use conventional Wasmtime imports + remove dummy_waker
* Reduce duplication in `*_disabled`
* Remove some unncessary bounds
* Remove some `for<'a>` bounds where unnecessary
* Remove another bound
* Defer more functions to the next PR
`drop_fibers` is different in the next PR, so defer it to then.
* Remove some reexports no longer necessary
Bindings generation changed awhile back so these aren't needed, defer the implementations to the next PR.
* Remove unnecessary drop
This was already moved to `run_manual_drop_routines`
* Defer a `pub(crate)` to a future PR
* Expand comments in traphandlers
* Defer some types to the next PR
* Update linker documentation
* Add `Send`/`Sync` bounds to `ComponentType`
This commit is extracted from from review of #11123 and #11127. While not literally present in those PRs it's my own personal conclusion that it's best to just go ahead and add these bounds at the "base" of the component trait hierarchy. The current implementation in #11123 adds bounds in many locations and this would remove the need to add bounds everywhere and instead have everything inherited through the `Lift` and `Lower` traits.
This raises the question of: why? The main conclusion that I've reached leading to this change is that Wasmtime currently will store `R`, a return value, on the stack during the lowering process back into linear memory. This might involve allocation, however, meaning that wasm can be invoked and a context switch could happen. For Wasmtime's `unsafe impl` of `Send` and `Sync` on fibers to be sound it requires that this stack-local variable is also `Send` and `Sync` as it's an entirely user-provided type. Thus I've concluded that for results it's always required for these to be both `Send` and `Sync` (or at the very least, `Send`).
Given that I've gone ahead and updated to require both `Send` and `Sync` for both params and results. This is not expected to actually have any impact in practice since all primitives are already `Send`/`Sync` (minus `Rc` impls all removed here) and all `bindgen!`-generated types are compositions of `Send`/`Sync` primitives meaning that they're also `Send` and `Sync`.
* Remove some now-unnecessary bounds
* Fix build after #11160
* Remove some now-unnecessary duplicate bounds
* Uncomment test that now works
* Undo accidental doc wrap
* Clarify comment on `Value` types
Don't leave `TODO` in public-facing documentation ideally
* Actually resolve the conflict (forgot to commit)
* Avoid returning boxed futures in APIs
* Defer making constructors more public to a future PR
* Make a method name more conventional
* Refactor `linear_lift_into_from_memory`
* Drop the `max_count` parameter in favor of slicing the `WasmList` itself. Avoids situations such as what happens if `max_count` is larger than the length of the list. * Don't have the default implementation collect to a vector and then push all that onto a different vector. Instead push each item individually through `extend`.
* De-indent a block of code added
* Remove unsafety from `prepare_call`
Mostly move the parameters themselves to the closure to avoid raw pointers/drop/etc.
This will have the consequence of in the future `call_async` is going to now require `Params: 'static` but that seems more-or-less inevitable at this point.
* Go back to returning box, alas.
* Apply same treatment to lift function
Make it a closure and reduce some levels of indirection of the various functions in play.
* Refactor `lower_params` to require less context.
Relax the bounds on the closure specified since it's immediately called and then additionally take out parameters/captures that the closure can carry itself.
* Don't pass extraneous `Instance` parameter
This can now be inferred from `Func`.
* Clean up some SAFETY comments
* Generalize the signature of `lift_results`
* Move `lift_results` function to `Func`
Also rename the lift/lower helpers to `with_{lift,lower}_context`
* Remove parameter from `with_lift_context`
Like `with_lower_context` this is fine to capture in the closure passed in.
* Simplify the dynamic lifting logic
Don't call `with_lift_context` in two locations, only call it once with a dynamic parameter.
* Refactor away the `Func::lift_results_sync` helper
* Use `with_lift_context` in `call_raw`
* Simplify a call to `Func::call_unchecked_raw`
* Ungate `with_lift_context` to fix non-cm-async build
* Fix compile (bad cherry-pick conflict resolution)
* Use `with_lower_context` in `call_raw`
Trying to unify the async/concurrent paths as much as possible.
* Move params out of `call_raw`
Let closures capture the params, no need to thread it through as an unnecessary argument.
* Clean up unsafety in `Func::call_raw`
* Accurately mark `call_raw` itself as `unsafe`, then document why callers should be safe. * Don't have one large `unsafe` block in `call_raw`, instead split it up with separate safety comments.
* Move a one-off type definition closer to its use
* Avoid intermediate allocations in dynamic calls
* Simplify a future-return site
* Deduplicate checking parameter count
* Simplify a future invocation with `?`
* Simplify a variable declaration
* Simplify some function signatures
* Remove outdated safety comment
* Refactor to not require `Params: 'static` on `call_async`
* Remove no-longer-necessary SAFETY comment
* Fix typos
* Add a fast-path with no `Box` for sync host functions
Speeds up host calls by ~20% and puts them back on parity with the beforehand numbers Wasmtime has.
* Synchronize signatures of async/concurrent dynamic calls
Use slices for both instead of vecs for one and slices for the other. Required some slight rejiggering. Apparently one can solve a closure problem with another closure, then one surely has no more closure problems.
* Fix non-cm-async build
---------
Signed-off-by: Joel Dice <[email protected]> Co-authored-by: Alex Crichton <[email protected]>
show more ...
|
|
Revision tags: v34.0.1, v33.0.1, v24.0.3, v32.0.1, v34.0.0, v33.0.0, v32.0.0, v31.0.0, v30.0.2, v30.0.1, v30.0.0, v29.0.1, v29.0.0, v28.0.1, v28.0.0, v27.0.0, v26.0.1, v25.0.3, v24.0.2, v26.0.0, v21.0.2, v22.0.1, v23.0.3, v25.0.2, v24.0.1, v25.0.1, v25.0.0, v24.0.0, v23.0.2, v23.0.1, v23.0.0, v22.0.0, v21.0.1, v21.0.0, v20.0.2 |
|
| #
81a89169 |
| 04-May-2024 |
Alex Crichton <[email protected]> |
Add support for `#![no_std]` to the `wasmtime` crate (#8533)
* Always fall back to custom platform for Wasmtime
This commit updates Wasmtime's platform support to no longer require an opt-in `RUSTF
Add support for `#![no_std]` to the `wasmtime` crate (#8533)
* Always fall back to custom platform for Wasmtime
This commit updates Wasmtime's platform support to no longer require an opt-in `RUSTFLAGS` `--cfg` flag to be specified. With `no_std` becoming officially supported this should provide a better onboarding experience where the fallback custom platform is used. This will cause linker errors if the symbols aren't implemented and searching/googling should lead back to our docs/repo (eventually, hopefully).
* Change Wasmtime's TLS state to a single pointer
This commit updates the management of TLS to rely on just a single pointer rather than a pair of a pointer and a `bool`. Additionally management of the TLS state is pushed into platform-specific modules to enable different means of managing it, namely the "custom" platform now has a C function required to implement TLS state for Wasmtime.
* Delay conversion to `Instant` in atomic intrinsics
The `Duration` type is available in `no_std` but the `Instant` type is not. The intention is to only support the `threads` proposal if `std` is active but to assist with this split push the `Duration` further into Wasmtime to avoid using a type that can't be mentioned in `no_std`.
* Gate more parts of Wasmtime on the `profiling` feature
Move `serde_json` to an optional dependency and gate the guest profiler entirely on the `profiling` feature.
* Refactor conversion to `anyhow::Error` in `wasmtime-environ`
Have a dedicated trait for consuming `self` in addition to a `Result`-friendly trait.
* Gate `gimli` in Wasmtime on `addr2line`
Cut down the dependency list if `addr2line` isn't enabled since then the dependency is not used. While here additionally lift the version requirement for `addr2line` up to the workspace level.
* Update `bindgen!` to have `no_std`-compatible output
Pull most types from Wasmtime's `__internal` module as the source of truth.
* Use an `Option` for `gc_store` instead of `OnceCell`
No need for synchronization here when mutability is already available in the necessary contexts.
* Enable embedder-defined host feature detection
* Add `#![no_std]` support to the `wasmtime` crate
This commit enables compiling the `runtime`, `gc`, and `component-model` features of the `wasmtime` crate on targets that do not have `std`. This tags the crate as `#![no_std]` and then updates everything internally to import from `core` or `alloc` and adapt for the various idioms. This ended up requiring some relatively extensive changes, but nothing too too bad in the grand scheme of things.
* Require `std` for the perfmap profiling agent
prtest:full
* Fix build on wasm
* Fix windows build
* Remove unused import
* Fix Windows/Unix build without `std` feature
* Fix some doc links
* Remove unused import
* Fix build of wasi-common in isolation
* Fix no_std build on macos
* Re-fix build
* Fix standalone build of wasmtime-cli-flags
* Resolve a merge conflict
* Review comments
* Remove unused import
show more ...
|
|
Revision tags: v20.0.1, v20.0.0, v17.0.3, v19.0.2, v18.0.4, v19.0.1, v19.0.0, v18.0.3, v18.0.2, v17.0.2, v18.0.1, v18.0.0, v17.0.1 |
|
| #
d4242001 |
| 29-Jan-2024 |
Adam Bratschi-Kaye <[email protected]> |
Support compilation-only build by adding a `runtime` feature (#7766)
* Add `runtime` feature to `wasmtime` crate
This feature can be disabled to build `wasmtime` only for compilation. This can be u
Support compilation-only build by adding a `runtime` feature (#7766)
* Add `runtime` feature to `wasmtime` crate
This feature can be disabled to build `wasmtime` only for compilation. This can be useful when cross-compiling, especially on a target that can't run wasmtime itself (e.g. `wasm32`).
* prtest:full
* don't round pages without runtime feature
* fix async assertions
* move profiling into runtime
* enable runtime for wasmtime-wasi
* enable runtime for c-api
* fix build_artifacts in non-cache case
* fix miri extensions
* enable runtime for wast
* enable runtime for explorer
* support cranelift all-arch on wasm32
* add doc links for `WeakEngine`
* simplify lib runtime cfgs
* move limits and resources to runtime
* move stack to runtime
* move coredump and debug to runtime
* add runtime to coredump and async features
* add wasm32 build job
* combine engine modules
* single compile mod
* remove allow for macro paths
* add comments
show more ...
|