|
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 |
|
| #
0dbb6f3d |
| 31-Mar-2026 |
Chris Fallin <[email protected]> |
Exceptions: implement C API. (#12861)
* Exceptions: implement C API.
This PR implements C (and C++) API support for Wasm exceptions, one final remaining hurdle (aside from fuzz-testing) for making
Exceptions: implement C API. (#12861)
* Exceptions: implement C API.
This PR implements C (and C++) API support for Wasm exceptions, one final remaining hurdle (aside from fuzz-testing) for making exceptions tier-1 and on-by-default.
* Review feedback, and add exnref case to `wasmtime_val_t`.
* Review feedback: GC feature guard.
* clang-format
* add docs to exn.hh.
* Remove tag size asserts: broken on 32-bit platforms, but not needed for correctness wrt C struct.
show more ...
|
|
Revision tags: 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, 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, v35.0.0, v24.0.4, v33.0.2, v34.0.2, v34.0.1, v33.0.1, v24.0.3, v32.0.1, v34.0.0 |
|
| #
5603ee7b |
| 03-Jun-2025 |
Alex Crichton <[email protected]> |
Change component/instance maps to `PrimaryMap` (#10916)
* Change component/instance maps to `PrimaryMap`
This switches to using typed keys for these maps to be more idiomatic with the rest of Wasmt
Change component/instance maps to `PrimaryMap` (#10916)
* Change component/instance maps to `PrimaryMap`
This switches to using typed keys for these maps to be more idiomatic with the rest of Wasmtime and this has the additional benefit of compressing indices to 32-bits instead of the previous pointer-sized-bits.
* Fix an unused import
show more ...
|
| #
a30e7299 |
| 03-Jun-2025 |
Alex Crichton <[email protected]> |
Update the definition of `wasmtime::Table` (#10903)
This commit is similar to a prior commit modifying memories which refactors the internals of `wasmtime::Table` to not longer use a `Stored` index.
Update the definition of `wasmtime::Table` (#10903)
This commit is similar to a prior commit modifying memories which refactors the internals of `wasmtime::Table` to not longer use a `Stored` index. Instead a `StoreInstanceId` and a `DefinedTableIndex` is used instead. This enables construction of external-facing types to be trivial and zero-cost.
This additionally notably fixes an issue where triggering a GC in a store would unconditionally create a `Table`, pushing onto an internal vector in the store. This then would never be deallocated because the internal table lived as long as the `Store`. In effect this meant that triggering a GC would end up leaking memory by pushing more items onto internal `Store` table. This is fixed through this commit because creating a `wasmtime::Table` is now "free" and no longer requires any allocations.
show more ...
|
| #
4fcfe17a |
| 02-Jun-2025 |
Alex Crichton <[email protected]> |
Refactor the representation of `Func` (#10897)
* Refactor the representation of `Func`
This commit rewrites the internals of `wasmtime::Func`. The `Stored` type is no longer used meaning that it's
Refactor the representation of `Func` (#10897)
* Refactor the representation of `Func`
This commit rewrites the internals of `wasmtime::Func`. The `Stored` type is no longer used meaning that it's now free to create a `wasmtime::Func` at any time. It is effectively a store-tagged `NonNull<VMFuncRef>`. This required a few internal changes to how functions are passed around:
* Previously the insertion of a `wasm_call`-less `VMFuncRef` was deferred until the raw pointer was loaded. Now the insertion happens immediately as soon as the function is placed within a store. This is done to ensure that a `Func` corresponds to one exact `VMFuncRef` and that's it, and lazily filled in versions within the store are still lazily filled in but they're more eagerly allocated. This isn't expected to have much of an impact perf-wise since all these lazily allocated functions were already almost guaranteed to get lazily allocated anyway.
* Filling in "holes" in `VMFuncRef`, notably the `wasm_call` field, no longer happens lazily when the `VMFuncRef` is demanded. Instead during instantiation a pass is made to fill in holes with the new module being instantiated (after registration). Additionally when a lazily-allocated `VMFuncRef` is created the module registry is checked immediately. This means that all store-local `VMFuncRef` values are either filled in immediately or filled in during instantiation. This notably means that the previous logic in `Func::vmimport` is now "just" an `.unwrap()` with a lot of comments saying why the unwrap shouldn't panic.
* To implement this commit a previous optimization for the `Func` API was removed as well, namely `Func::call` will become slower after this commit. The `Func::call` API is a dynamically-typed API which requires run-time type-checking of arguments. Previously a `FuncType` was loaded into a cache once-per-`Func` which helped amortize the cost of using `Func::call` repeatedly. Now, though, there's no natural place to put such a cache since `Func` no longer has dedicated storage within a `Store`. Historically this optimization was added for the C API before the `*_call_unchecked` APIs existed, but nowadays the `*_call_unchecked` APIs should suffice for performance-critical applications where needed. In the future it might also be possible to have a hash map in the `Store` of a `VMSharedTypeIndex` to `FuncType` which is lazily populated based on calls to `Func::call`, but that feels a bit overkill nowadays for a possibly rarely-used map.
* The no-longer-necessary `RootedHostFunc` type is now gone as its unsafety and various contracts are subsumed by other preexisting `unsafe` blocks.
* The specific drop order between `StoreOpaque::store_data` and `StoreOpaque::rooted_host_funcs` is removed. The `rooted_host_funcs` field now lives in the `func_refs` field and the `FuncKind` type, where the destructors came from before, is no more.
* The `func_refs` field has grown storage locations for a variety of "keep this thing alive as long as the store" related to functions and such.
Closes #10868
* Remove mutability from locations that no longer need it
* Update crates/wasmtime/src/runtime/func.rs
Co-authored-by: Nick Fitzgerald <[email protected]>
* Update crates/wasmtime/src/runtime/store/func_refs.rs
Co-authored-by: Nick Fitzgerald <[email protected]>
---------
Co-authored-by: Nick Fitzgerald <[email protected]>
show more ...
|
| #
c4fd2f7b |
| 02-Jun-2025 |
Alex Crichton <[email protected]> |
Refactor globals to no longer use `Stored` (#10902)
This commit refactors the `wasmtime::Global` to avoid the usage of `Stored<T>` internally. This makes conversion from internal global state to ext
Refactor globals to no longer use `Stored` (#10902)
This commit refactors the `wasmtime::Global` to avoid the usage of `Stored<T>` internally. This makes conversion from internal global state to external global state a noop along the lines of previous commits. The end goal is to remove `Stored` entirely and enable more pervasively using external types internally within Wasmtime as well.
Globals were different than the prior iterations of memories, tags, and tables. Globals have three different ways of defining them: wasm instances, the host embedder, and component flags. Representing these in all the various locations required a bit of finesse in how everything is represented and stored at rest and such. In the end there's a small amount of "type punning" in a few instance/vmctx fields related to globals now since everything is squeezed into one slot. This is required because the `VMGlobalImport` structure must have a size known to wasm-compiled code and `wasmtime::Global` must have a known layout for C code.
In the end while this is more code to manage globals my hope is that the end result will be a net negative in terms of complexity by ensuring that the embedder API is additionally suitable for use internally within Wasmtime as well.
show more ...
|
| #
0e9a691d |
| 30-May-2025 |
Alex Crichton <[email protected]> |
Update the definition of `wasmtime::Memory` (#10877)
Powered by the previous commit this change updates the internal implementation details of `wasmtime::Memory` to avoid the need for the use of `St
Update the definition of `wasmtime::Memory` (#10877)
Powered by the previous commit this change updates the internal implementation details of `wasmtime::Memory` to avoid the need for the use of `Stored`. This means that converting from a Wasmtime-internal representation of a memory to an external representation of a memory is largely a noop and no longer requires an allocation. This is intended to be more useful in the future to use the public types more pervasively inside of Wasmtime itself, but for now this is mostly the scaffolding necessary for such a change.
show more ...
|
|
Revision tags: 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, v20.0.1 |
|
| #
c6e4a502 |
| 24-Apr-2024 |
Alex Crichton <[email protected]> |
c-api: Tidy up some `wasmtime_func_t` usage (#8461)
* c-api: Tidy up some `wasmtime_func_t` usage
Try to avoid using a `transmute` in the implementation of the C API and instead use a `union` like
c-api: Tidy up some `wasmtime_func_t` usage (#8461)
* c-api: Tidy up some `wasmtime_func_t` usage
Try to avoid using a `transmute` in the implementation of the C API and instead use a `union` like is being done in #8451. Additionally add some helper functions to the header to work with null funcref values instead of only documenting the implementation.
* Try to fix doxygen
show more ...
|
|
Revision tags: v20.0.0 |
|
| #
ca5f1bb6 |
| 14-Apr-2024 |
Alex Crichton <[email protected]> |
Tidy up some headers related to shared memory (#8366)
* Tidy up some headers related to shared memory
* Don't declare an anonymous `struct wasmtime_sharedmemory`, instead `#include` the actual de
Tidy up some headers related to shared memory (#8366)
* Tidy up some headers related to shared memory
* Don't declare an anonymous `struct wasmtime_sharedmemory`, instead `#include` the actual definition. * Fix an issue where a header in `sharedmemory.h` referred to a type in `extern.h` which wasn't `#include`'d. This function, `wasmtime_sharedmemory_into_extern`, additionally isn't necessary as it's no different than manually constructing it. Fix this by removing this function.
* Run clang-format
show more ...
|
|
Revision tags: v17.0.3, v19.0.2, v18.0.4, v19.0.1, v19.0.0, v18.0.3 |
|
| #
55bd797a |
| 08-Mar-2024 |
Milek7 <[email protected]> |
Extend C API with interfaces needed to use threads (#7940)
|
|
Revision tags: v18.0.2, v17.0.2, v18.0.1, v18.0.0, v17.0.1, v17.0.0, v16.0.0, v15.0.1 |
|
| #
f8fee938 |
| 29-Nov-2023 |
Tyler Rockwood <[email protected]> |
add clang format (#7601)
* add clang-format
We chose WebKit style because out of all the builtin styles it seems the closest to what already exists in wasmtime.
Signed-off-by: Tyler Rockwood <rock
add clang format (#7601)
* add clang-format
We chose WebKit style because out of all the builtin styles it seems the closest to what already exists in wasmtime.
Signed-off-by: Tyler Rockwood <[email protected]>
* c-api: don't reorder headers
The order here matters
Signed-off-by: Tyler Rockwood <[email protected]>
* c-api: apply clang-format
Signed-off-by: Tyler Rockwood <[email protected]>
* fiber: apply clang-format
Signed-off-by: Tyler Rockwood <[email protected]>
* runtime: apply clang-format
Signed-off-by: Tyler Rockwood <[email protected]>
* examples: apply clang format
Signed-off-by: Tyler Rockwood <[email protected]>
* tests: apply clang-format
Signed-off-by: Tyler Rockwood <[email protected]>
* ci: add clang-format checks
Signed-off-by: Tyler Rockwood <[email protected]>
* clang-format: keep braces on the same line
This is more the existing style
Signed-off-by: Tyler Rockwood <[email protected]>
* remove clang-format
Just use the tool defaults (LLVM)
Signed-off-by: Tyler Rockwood <[email protected]>
* Fix ci name
Signed-off-by: Tyler Rockwood <[email protected]>
* manually reformat a couple of comments
prtest:full
Signed-off-by: Tyler Rockwood <[email protected]>
* disable formatting for doc-wasm.h
Signed-off-by: Tyler Rockwood <[email protected]>
* manually reformat wasmtime.h
Signed-off-by: Tyler Rockwood <[email protected]>
* disable formatting
To prevent a link from being broken
Signed-off-by: Tyler Rockwood <[email protected]>
* examples: fixing build commands
Signed-off-by: Tyler Rockwood <[email protected]>
* fix parameter comment
Signed-off-by: Tyler Rockwood <[email protected]>
---------
Signed-off-by: Tyler Rockwood <[email protected]>
show more ...
|
|
Revision tags: v15.0.0, v14.0.4, v14.0.3, v14.0.2, v13.0.1, v14.0.1, v14.0.0, minimum-viable-wasi-proxy-serve, v13.0.0, v12.0.2, v11.0.2, v10.0.2, v12.0.1, v12.0.0, v11.0.1, v11.0.0, v10.0.1, v10.0.0, v9.0.4, v9.0.3, v9.0.2, v9.0.1, v9.0.0, v6.0.2, v7.0.1, v8.0.1, v8.0.0, v7.0.0, v6.0.1, v5.0.1, v4.0.1, v6.0.0, v5.0.0, v4.0.0, v3.0.1, v3.0.0, v1.0.2, v2.0.2, v2.0.1, v2.0.0, v1.0.1, v1.0.0, v0.40.1, v0.40.0, v0.39.1, v0.38.3, v0.38.2, v0.39.0, v0.38.1, v0.38.0, v0.37.0, v0.36.0, v0.35.3, v0.34.2, v0.35.2 |
|
| #
76b82910 |
| 23-Mar-2022 |
Alex Crichton <[email protected]> |
Remove the module linking implementation in Wasmtime (#3958)
* Remove the module linking implementation in Wasmtime
This commit removes the experimental implementation of the module
linking WebA
Remove the module linking implementation in Wasmtime (#3958)
* Remove the module linking implementation in Wasmtime
This commit removes the experimental implementation of the module
linking WebAssembly proposal from Wasmtime. The module linking is no
longer intended for core WebAssembly but is instead incorporated into
the component model now at this point. This means that very large parts
of Wasmtime's implementation of module linking are no longer applicable
and would change greatly with an implementation of the component model.
The main purpose of this is to remove Wasmtime's reliance on the support
for module-linking in `wasmparser` and tooling crates. With this
reliance removed we can move over to the `component-model` branch of
`wasmparser` and use the updated support for the component model.
Additionally given the trajectory of the component model proposal the
embedding API of Wasmtime will not look like what it looks like today
for WebAssembly. For example the core wasm `Instance` will not change
and instead a `Component` is likely to be added instead.
Some more rationale for this is in #3941, but the basic idea is that I
feel that it's not going to be viable to develop support for the
component model on a non-`main` branch of Wasmtime. Additionaly I don't
think it's viable, for the same reasons as `wasm-tools`, to support the
old module linking proposal and the new component model at the same
time.
This commit takes a moment to not only delete the existing module
linking implementation but some abstractions are also simplified. For
example module serialization is a bit simpler that there's only one
module. Additionally instantiation is much simpler since the only
initializer we have to deal with are imports and nothing else.
Closes #3941
* Fix doc link
* Update comments
show more ...
|
|
Revision tags: v0.35.1, v0.35.0, v0.33.1, v0.34.1, v0.34.0, v0.33.0, v0.32.1, v0.32.0, v0.31.0, v0.30.0, v0.29.0 |
|
| #
f3b80ece |
| 15-Jul-2021 |
Stephan Renatus <[email protected]> |
c-api: add wasmtime_trap_code (#3086)
Eventually this should be added to the wasmtime-go binding, addressing
https://github.com/bytecodealliance/wasmtime-go/issues/63.
Added a snippet to example
c-api: add wasmtime_trap_code (#3086)
Eventually this should be added to the wasmtime-go binding, addressing
https://github.com/bytecodealliance/wasmtime-go/issues/63.
Added a snippet to examples/interrupt.c to verify that this works as
expected in manual testing.
Signed-off-by: Stephan Renatus <[email protected]>
show more ...
|
|
Revision tags: v0.28.0 |
|
| #
7a1b7cdf |
| 03-Jun-2021 |
Alex Crichton <[email protected]> |
Implement RFC 11: Redesigning Wasmtime's APIs (#2897)
Implement Wasmtime's new API as designed by RFC 11. This is quite a large commit which has had lots of discussion externally, so for more inform
Implement RFC 11: Redesigning Wasmtime's APIs (#2897)
Implement Wasmtime's new API as designed by RFC 11. This is quite a large commit which has had lots of discussion externally, so for more information it's best to read the RFC thread and the PR thread.
show more ...
|