|
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 |
|
| #
967f4601 |
| 23-Dec-2025 |
Joel Dice <[email protected]> |
generate precise traps in component adapters (#12215)
* generate precise traps in component adapters
Previously, we generated a generic `unreachable` instruction for each trap in a fused adapter, p
generate precise traps in component adapters (#12215)
* generate precise traps in component adapters
Previously, we generated a generic `unreachable` instruction for each trap in a fused adapter, plus some metadata to recover the specific kind of trap. However, that metadata was never hooked up to anything, so we only got a generic `unreachable` message at runtime.
This commit removes the metadata tracking and instead simply calls a host intrinsic, passing the trap code as a parameter. This is somewhate pessimal compared with what we had before, but improves ergonomics and allows us to avoid forking as many tests from the component-model repo.
If performance becomes an issue, we can easily add an option to skip the host call and only emit an `unreachable` instruction as before.
Note that I've removed forked versions of three tests in favor of their upstream equivalents.
Fixes #11683
* update `strings.rs` tests
* bless disas tests
show more ...
|
|
Revision tags: 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 |
|
| #
cfc05638 |
| 12-Aug-2025 |
Nick Fitzgerald <[email protected]> |
Make Wasmtime's `FuncKey` one-to-one with Cranelift's `ir::UserExternalName` (#11415)
* Make Wasmtime's `FuncKey` one-to-one with Cranelift's `ir::UserExternalName`
`FuncKey`, which used to be call
Make Wasmtime's `FuncKey` one-to-one with Cranelift's `ir::UserExternalName` (#11415)
* Make Wasmtime's `FuncKey` one-to-one with Cranelift's `ir::UserExternalName`
`FuncKey`, which used to be called `CompileKey`, is now one-to-one with `cranelift_codegen::ir::UserExternalName`, and is used for not just identifying compilation objects but also relocations and call-graph edges. This allows us to determine the `StaticModuleIndex` and `DefinedFuncIndex` pair for any `cranelift_codegen::ir::FuncRef`, regardless of inlining depth, which fixes some fuzz bugs on OSS-Fuzz.
This continues pushing on the idea that Wasmtime's compilation orchestration and linking should be relatively agnostic to the kinds of things it is actually compiling and linking, allowing us to tweak, add, and remove new kinds of `FuncKey`s more easily. Adding a new `FuncKey` should not require modifying relocation resolution, for example, just a little bit of code to run the associated compilation and optionally some code to extract metadata into our final artifacts for querying at runtime. Everything in between should Just Continue Working. We still aren't all the way there yet, but this does bring us a little bit closer.
Finally, in Cranelift's inlining pass, this adds a check that a block is inserted in the layout before attempting to remove it from the layout, which would otherwise cause panics. This was triggered by multi-level inlining and now-unreachable blocks in the inner callees.
I'll note that this does update basically all of the disas tests, or at least nearly all of them that make function calls. This is because the namespace/index numbering pair changed slightly to align with `FuncKey`, but that should pretty much be the only changes.
* remove debug info from panic message, it is only available in some `cfg`s
* fill out module doc comment
* Fix compilation without `component-model` feature
* Fix some more cfg compilations
* cargo fmt
* fix a wrong `&dyn Any` auto coercion; add helpful debug logging and assertions for this kind of thing
show more ...
|
|
Revision tags: v35.0.0, v24.0.4, v33.0.2, v34.0.2 |
|
| #
326795f5 |
| 15-Jul-2025 |
Nick Fitzgerald <[email protected]> |
Make direct calls to statically-known imported functions (#11228)
* Make direct calls to statically-known imported functions
This will allow for their eventual inlining.
* address review feedback
Make direct calls to statically-known imported functions (#11228)
* Make direct calls to statically-known imported functions
This will allow for their eventual inlining.
* address review feedback and fix up some disas tests
* Add native code disassembly test
* disas: sort `read_dir` entries for deterministic order
Because we always use namespace 0 for wasm functions when creating CLIF functions, sorting the parsed CLIF functions by (namespace, index) does not differentiate between the `index`th Wasm function in two different modules in the same component, meaning we would pass through whatever ordering reading from the filesystem gave us, which can be non-deterministic across platforms. Instead, sort the directory entries based on file paths.
* fix clippy
show more ...
|
|
Revision tags: v34.0.1, v33.0.1, v24.0.3, v32.0.1, v34.0.0 |
|
| #
e5aa4449 |
| 16-Jun-2025 |
Nick Fitzgerald <[email protected]> |
Handle `uextend` in conditional trap lowerings on x64 (#11044)
* Handle uextend in conditional trap lowerings on x64
* Logging and rebuilding for test programs and debug tests
* Forward srcloc deb
Handle `uextend` in conditional trap lowerings on x64 (#11044)
* Handle uextend in conditional trap lowerings on x64
* Logging and rebuilding for test programs and debug tests
* Forward srcloc debug info to conditional trap instructions from conditional branches to unconditional traps
show more ...
|
| #
a252f37e |
| 11-Jun-2025 |
Alex Crichton <[email protected]> |
Remove dead `callee` field of vmctx (#11014)
* Remove dead `callee` field of vmctx
This was used long ago but refactorings since then have removed the need for its existence, so remove it outright.
Remove dead `callee` field of vmctx (#11014)
* Remove dead `callee` field of vmctx
This was used long ago but refactorings since then have removed the need for its existence, so remove it outright.
* Update test expectations
* Shuffle around some imports
show more ...
|
| #
a80dd80d |
| 09-Jun-2025 |
Nick Fitzgerald <[email protected]> |
Cranelift: Rewrite conditional branches to unconditional traps into conditional traps during legalization (#10988)
* Cranelift: Legalize via a backwards walk, rather than forwards
Note: the test ex
Cranelift: Rewrite conditional branches to unconditional traps into conditional traps during legalization (#10988)
* Cranelift: Legalize via a backwards walk, rather than forwards
Note: the test expectation change in `filetests/egraph/misc.clif` is simply because we happen to change the order in which we created the legalized `stack_addr` instructions that get GVN'd together, and therefore also changed their relative value numbering. We dedupe to the value that occurs first in the function, which is the one inserted into the DFG *after* the other now because of the backwards traversal, and it therefore has a different value number from before. The resulting program is identical, modulo value numbering.
* Cranelift: Rewrite conditional branches to unconditional traps into conditional traps during legalization
Given this instruction:
```clif brif v0, block1, block2 ```
If we know that `block1` does nothing but immediately trap then we can rewrite that `brif` into the following:
```clif trapz v0, <trapcode> jump block2 ```
(And we can do the equivalent with `trapz` if `block2` immediately traps).
This transformation allows for the conditional trap instructions to be GVN'd and for our egraphs mid-end to generally better optimize the program. We additionally have better codegen in our backends for `trapz` than branches to unconditional traps.
Fixes https://github.com/bytecodealliance/wasmtime/issues/10941
* Update CLIF filetests and Wasmtime disas tests
show more ...
|
| #
ac7729de |
| 06-Jun-2025 |
Alex Crichton <[email protected]> |
Align symbol names with `--emit-clif` (#10947)
* Align symbol names with `--emit-clif`
This commit fixes two issues: (1) is that `--emit-clif` generates file names that are different from symbol na
Align symbol names with `--emit-clif` (#10947)
* Align symbol names with `--emit-clif`
This commit fixes two issues: (1) is that `--emit-clif` generates file names that are different from symbol names and (2) is that `--emit-clif` for components today has collisions on filenames which means that output files can get corrupted. Currently (2) is causing spurious failures in CI due to the test added in #10939 being the first test with a component and functions in modules where they clash to emit the same file.
* Fix typo
* Fix tests
* Fix tests on Windows
Can't use `:` in filenames on Windows
prtest:full
show more ...
|
| #
f669c0a7 |
| 05-Jun-2025 |
Nick Fitzgerald <[email protected]> |
Simplify and optimize the way that `enum`s are passed in fused adapters (#10939)
* Simplify and optimize the way that `enum`s are passed in fused adapters
instead of treating them like variants tha
Simplify and optimize the way that `enum`s are passed in fused adapters (#10939)
* Simplify and optimize the way that `enum`s are passed in fused adapters
instead of treating them like variants that don't have payloads, just check that the discriminant is in bounds.
* cargo +stable fmt
show more ...
|