Commit Graph

1718 Commits

Author SHA1 Message Date
Josh Triplett
f27e0ad53c wasmtime-wasi-c: allow(non_snake_case) to suppress warnings on consecutive underscores (#461)
wasmtime-wasi-c contains many bindgen-generated symbols like
bindgen_test_layout___wasi_event_t___wasi_event_u___wasi_event_u_fd_readwrite_t
that contain triple-underscores in them. rustc doesn't consider those
names snake-case and generates extensive warnings about them. Suppress
those warnings with allow(non_snake_case).
2019-10-28 11:42:46 +01:00
Andrew Brown
3053444b57 Add more SIMD spec tests (#388)
* 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
2019-10-25 06:18:41 -07:00
vms
a34439de42 optimize memory.grow 0 (#443) 2019-10-24 15:56:04 -07:00
Artur Jamro
5a10879d5b Enable assert_unlinkable check (#451) 2019-10-24 15:37:01 -07:00
Jakub Konka
875eea6052 Update poll_oneoff's signature
This PR updates `wasmtime_wasi` crate by adjusting `poll_oneoff`'s
signature to that introduced in `wasi_common` in
CraneStation/wasi-common#137. This change is required in order to
fix #440.
2019-10-24 11:47:35 +02:00
Dan Gohman
a7fa6bdb31 Fix fuzz and wasi-c builds (#447)
* Fix the wasmtime-wasi-c crate build and upgrade it to Rust 2018.

* Fix the fuzz build.
2019-10-23 14:05:23 -07:00
Yury Delendik
876d5e1075 [wasmtime-api] Multi value api support (#448) 2019-10-23 14:09:27 -05:00
Johnnie Birch
a3dd4b91e1 Fix lightbeam build broken when supporting ModuleTranslateState (#445) 2019-10-22 16:18:54 -07:00
Andrew Brown
8c4cbf9a55 Update SIMD spec tests to latest upstream revision (#444) 2019-10-22 16:16:51 -07:00
Alex Crichton
e37168a88d Add back wasmtime-wast support for V128 (#442)
Accidentally left removed #434 when I meant to add it back in! Updates
the `wast` crate dependency and adds support for translating
`v128.const` instructions to a `RuntimeValue`

Closes #441
2019-10-21 15:51:59 -07:00
Alex Crichton
9947bc5209 Switch from wabt crate to wast (#434)
* Switch lightbeam from `wabt` to `wast`

Switch from a C++-based `*.wat` parser to a Rust-based parser

* Remove unneeded `wabt` dev-dependency from wasmtime-api

* Rewrite `wasmtime-wast` crate with `wast-parser`

This commit moves the `wasmtime-wast` crate off the `wabt` crate on to
the `wast-parser` crate which is a Rust implementation of a `*.wast` and
`*.wat` parser. The intention here is to continue to reduce the amount
of C++ required to build wasmtime!

* Use new `wat` and `wast` crate names
2019-10-18 13:25:48 -07:00
Dan Gohman
ebef2c6b57 Rename "always_lightbeam" to "lightbeam" in more places. (#404) 2019-10-17 17:15:31 -07:00
Dan Gohman
877152ee5c Use the libstd instead of the errno crate in wasmtime-runtime. (#408)
Rust's standard library now has a way to read the OS errno value, so use
that instead of depending on the errno crate in wasmtime-runtime.
2019-10-17 17:14:57 -07:00
Alex Crichton
50beb21b63 Add a missing api to the wasm C API (#433)
This was used when [prototyping] but I found it wasn't implemented yet!

[prototyping]: https://github.com/dtolnay/watt/issues/2#issuecomment-543007365
2019-10-17 17:14:15 -07:00
Nick Fitzgerald
842faf5aa6 Support for multi-value wasm (#399)
* 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.
2019-10-17 17:12:01 -07:00
Jakub Konka
9d54f84a32 Fast-forward wasi-common to latest git rev 2019-10-17 12:02:58 +02:00
YAMAMOTO Yuji
d05561ff78 Fix deadlink to WASI API header (#431)
Fix documentation link to wasi-libc headers
2019-10-17 11:21:44 +02:00
Artur Jamro
872f6aa03d Fix opt_level builder flag (#411) 2019-10-10 12:14:45 -07:00
Dan Gohman
8e593506dc Don't run the spec_testsuite tests if the submodule isn't checked out. (#409)
* 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`.
2019-10-09 13:34:09 -07:00
Dan Gohman
fd3efad781 Various clippy fixes. (#403) 2019-10-09 13:32:52 -07:00
Dan Gohman
9465668199 Fix a TODO comment. (#405)
The parameter to defined_func_index is in the defined-function space, so calling
func_index on it works to translate it into module space.
2019-10-09 09:33:41 -07:00
Dan Gohman
6494728101 Update the README.md. (#410)
* Update the README.md.

Feature the wasmtime.dev website, update WASI content.

With Lightbeam moving into the Wasmtime repo, it's no longer necessary
to use git submodules to build Wasmtime.
2019-10-09 08:19:52 -07:00
Dan Gohman
8e1b44b29c Make more code work with no_std. (#407)
* Make more code work with no_std.

no_std support is still incomplete, but this patch takes care of the
bulk of the straightforward parts.
2019-10-08 16:53:32 -07:00
Dan Gohman
c0b37bb713 Merge pull request #406 from sunfishcode/wabt-workaround
Improve the workaround for what is now wabt issue #59.
2019-10-07 10:21:13 -07:00
Dan Gohman
292323229c Improve the workaround for what is now wabt issue #59.
wabt's ScriptParser doesn't appear to handle paths containing
directories, so just use basenames for now.
2019-10-07 06:00:43 -07:00
Dan Gohman
53291a8497 Merge pull request #397 from sunfishcode/integrate-lightbeam
Integrate Lightbeam
2019-10-04 20:06:04 -07:00
Dan Gohman
6ef46e0497 Use the Lightbeam cargo feature. 2019-10-04 18:12:06 -07:00
Dan Gohman
fb2a89a1b1 Fix compilation error by bringing in Lightbeam. 2019-10-04 17:36:14 -07:00
Dan Gohman
5ccdf13b11 Rename --always-cranelift to --cranelift.
Also, enable use of Lightbeam in wasm2obj.
2019-10-04 17:02:31 -07:00
Dan Gohman
36756613b8 Merge remote-tracking branch 'origin/master' into integrate-lightbeam 2019-10-04 16:11:12 -07:00
Jakub Konka
daa3c3aeef Update wasi-common version 2019-10-03 23:59:18 +02:00
Dan Gohman
1017cbbf63 Update the compile fuzzer for Lightbeam changes. 2019-10-02 14:27:21 -07:00
Dan Gohman
8d89c3b479 Add options to wasmtime and wasm2obj to pick compilation strategy. 2019-10-02 13:59:49 -07:00
Dan Gohman
d4353f03cb Don't check assert_trap tests when Lightbeam is enabled.
Lightbeam doesn't yet produce trap metadata, so it can't yet match the
expected `assert_trap` messages. Disable them for now.
2019-10-02 13:42:26 -07:00
Dan Gohman
7092499c10 Update wasmtime-rust for new API. 2019-10-02 12:52:44 -07:00
Dan Gohman
c43803b19c Update dependencies. 2019-10-02 12:32:31 -07:00
Dan Gohman
239f412616 Test Lightbeam. 2019-10-02 12:32:18 -07:00
Dan Gohman
5bf2fc0ffa Don't enable Lightbeam tests if Lightbeam isn't enabled. 2019-10-02 12:06:00 -07:00
Dan Gohman
65b8afabe6 Make use of Lightbeam configurable.
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.
2019-10-02 11:54:06 -07:00
Dan Gohman
8c524815c3 Update dependencies. 2019-10-02 11:00:28 -07:00
Dan Gohman
8d52e389f8 Update Lightbeam for various API changes. 2019-10-02 10:10:32 -07:00
Dan Gohman
9757f7194c Merge Lightbeam into Wasmtime. 2019-10-02 09:49:38 -07:00
Dan Gohman
4cf15bd8c4 Remove the Lightbeam submodule. 2019-10-02 09:48:05 -07:00
Dan Gohman
5832eff76f Merge remote-tracking branch 'yurydelendik-lightbeam/cranelift-32' 2019-10-02 09:45:54 -07:00
Dan Gohman
8298a7a8b5 Merge remote-tracking branch 'jlb6740-lightbeam/update_cranelift_cg_ver_44' 2019-10-02 09:44:35 -07:00
Dan Gohman
6e963b670e Delete .rustfmt.toml 2019-10-02 09:34:09 -07:00
Dan Gohman
25a7e00d50 Delete .gitignore 2019-10-02 09:33:58 -07:00
Dan Gohman
6d5937dee0 Move lightbeam into a subdirectory. 2019-10-02 09:26:36 -07:00
Peter Huene
cb38b48156 Fix memory leaks in extern conversion functions in C API. (#395)
This fixes the memory leaks in the following functions which should not be
returning "owned" pointers:

* `wasm_extern_as_func`
* `wasm_func_as_extern`
* `wasm_extern_as_global`
* `wasm_global_as_extern`
* `wasm_extern_as_memory`
* `wasm_extern_as_table`

Additionally, this commit implements the `wasm_memory_as_extern` and
`wasm_table_as_extern` functions.

Fixes #394.
2019-10-02 05:54:36 -07:00
Johnnie Birch
5096d7cf92 Updates Cranelift Codegen dependence to 0.44
In trying to build the lightbeam feature in wasmtime there are
compile errors mostly related to outdated or missing trait
definitions. This patch moves the current cranelift codegen
dependence to 0.44 in support of that, though other changes
are still needed in wasmtime to get the feature to build.
2019-10-01 08:45:19 -07:00