* Update to the latest spec_testsuite and dependencies.
Update to target-lexicon 0.10, cranelift 0.54, wast 0.6, faerie 0.14,
and the latest spec_testsuite.
For wast and cranelift-wasm, update the code for API changes.
* Factor out the code for matching f32, f64, and v128.
This takes the idea from #802 to split out `f32_matches`, `f64_matches`,
and `v128_matches` functions, which better factor out the matching
functionality between scalar and vector.
This commit refactors the `wasmtime-wast` crate to internally make it a
bit more concise with less repetition. Additionally it also improves the
error messages by guaranteeing that all failed tests have context
indicating where the test was defined.
It turns out there was also a bug in the previous implementation where
an `AssertMalformed` directive with a `quote` module would accidentally
skip all further tests. This has now been fixed, and all futher tests
continued to pass except for the `simd_const.wast` test. This test has
been disabled temporarily but once the `wasmparser` and `wast` crates
are updated (being worked on independently) this should be possible to
re-enable.
They're read dynamically so there's no need to rebuild the test suite,
it'll automatically pick up the changes when it's read while the tests
are executed.
* Remove usage of `CompilationStrategy` from `Config`
This commit removes the public API usage of the internal
`CompilationStrategy` enumeration from the `Config` type in the
`wasmtime` crate. To do this the `enum` was copied locally into the
crate and renamed `Strategy`. The high-level description of this change
is:
* The `Config::strategy` method now takes a locally-defined `Strategy`
enumeration instead of an internal type.
* The contents of `Strategy` are always the same, not relying on Cargo
features to indicate which variants are present. This avoids
unnecessary downstream `#[cfg]`.
* A `lightbeam` feature was added to the `wasmtime` crate itself to
lightbeam compilation support.
* The `Config::strategy` method is now fallible. It returns a runtime
error if support for the selected strategy wasn't compiled in.
* The `Strategy` enum is listed as `#[non_exhaustive]` so we can safely
add variants over time to it.
This reduces the public crate dependencies of the `wasmtime` crate
itself, removing the need to reach into internal crates even more!
cc #708
* Fix fuzz targets
* Update nightly used to build releases
* Run rustfmt
This commit simplifies the build script slightly for generating tests by
doing a few dull refactorings:
* Leaves formatting to `rustfmt`
* Extract bulk of code execution into a top-level shared `run_wast`
function so each test is a one-liner
* Use `anyhow` for errors both in the script and in tests
We needed a workaround when using wabt on old Linux distros due to using
old versions of `strtof`. With the switch to `wat`, we no longer need
these workarounds.
This commit implements registering unwind information for JIT functions on
Windows so that the operating system can both walk and unwind stacks containing
JIT frames.
Currently this only works with Cranelift as lightbeam does not emit unwind
information yet.
This commit also resets the stack guard page on Windows for stack overflow
exceptions, allowing reliable stack overflow traps.
With these changes, all previously disabled test suite tests (not including
the multi-value tests) on Windows are now passing.
Fixes#291.
* Add more SIMD spec tests
Also provides a helper, extract_name, for building the names needed for the generated code
* Use `cargo test ... -- --nocapture` to see test errors in CI
* Use OS-independent paths for WAST files
* Ignore 'skip-stack-guard-page'
* Temporarily disable SIMD tests
* Re-enable SIMD spec tests and only disable on Windows temporarily
* deps: bump wasmparser to 0.39.2
This has a bug fix for multi-value Wasm validation that is required for getting
the spec tests passing.
https://github.com/yurydelendik/wasmparser.rs/pull/135
* Update cranelift to 0.46.1 to get multi-value Wasm support
The `cranelift_wasm` APIs had to change a little bit to maintain state necessary
when translating multi-value Wasm blocks. The `translate_module` function now
returns a `ModuleTranslationState` that is borrowed during each function's
translation.
* Enable multi-value proposal's spec tests
This enables all the Wasm multi-value proposal's spec tests other than the ones
that rely on functions having more return values than registers available on the
target. That is not supported by cranelift yet.
* wasmtime-interface-types: always use multi-value Wasm
And remove the return pointer hacks that work around the lack of multi-value.
* Don't run the spec_testsuite tests if the submodule isn't checked out.
This way, if someone checks out the repository without checking out the
submodules, they can still run "cargo test".
Also, fix a warning in the generated test runner code.
* Print a message if the spec_testsuite submodule is not enabled.
* Move the `#[cfg(test)]` to the top-level `mod`.
This adds a `--always-lightbeam` option as well as an `--always-cranelift`
option, to allow the compilation strategy to be selected via the
command-line. This also enables regular testing for Lightbeam.
* Workaround a rounding difference in the strtof function in Centos 6.
This difference causes the spec test const.wast to fail, so disable the
test on platforms where we detect the rounding difference occurs.
This Azure Pipelines setup compiles and tests Wasmtime for Linux, macOS, and Windows.
If the CI run was triggered by a new tag being created, a new release for that tag is created with a changelog relative to the last tag release and archives of the builds for all platforms.
If the CI run was triggered by new commits landing on `master`, the release `latest-master` is updated with a new changelog relative to the last tag release and archives of the new builds for all platforms.
Note: This PR also contains changes to disable a bunch of tests on Windows, which are failing due to issues with signal handling.
wasmtime-execute is now wasmtime-jit. Move `JITCode` and the TargetIsa
into a new `Compiler` type. `InstancePlus` is no more, with trampoline
functionality now handled by `Compiler`.
And lots of other miscellaneous changes. Rename InstanceWorld to
InstancePlus and reorganize its contents. This still isn't a great name,
but at least now it has a clear purpose.