Commit Graph

5615 Commits

Author SHA1 Message Date
Dan Gohman
7faa15d7ac More infrastructure.
Improve handling of memory.grow/size, add a standalone wast runner,
test harness improvements.
2018-12-05 02:25:34 -05:00
Dan Gohman
83f8a31010 Convert the wast test harness into a crate.
This uses a build.rs file to collect all the wast tests and create
individual `#[test]` lines for them, so that `cargo test` can run them
in parallel.
2018-12-05 02:25:34 -05:00
Dan Gohman
4c47ce9b53 Add support for math libcalls. 2018-12-05 02:25:34 -05:00
Dan Gohman
bd69768e0d Improve infrastructure.
Do more encapsulation of raw pointers, use more PrimaryMaps instead of
Vecs, add a table.rs for managing table storage.
2018-12-05 02:25:34 -05:00
Dan Gohman
fe1643733b Remove use of offset_of! from wasmtime-environ.
wasmtime-environ is meant to support cross compilation, so it shouldn't
have dependencies on target layout of structs. This moves the layout
back into wasmtime-execute, and adds a system of asserts for checking
that wasmtime-environ's offsets stay in sync.
2018-12-05 02:25:34 -05:00
Dan Gohman
099f85f821 Rename main.rs to wasmtime.rs. 2018-12-05 02:25:34 -05:00
Dan Gohman
e940c97664 Tidy. 2018-12-05 02:25:34 -05:00
Dan Gohman
8dbd4b8d7c Start a wast testing harness and add some tests.
This implements a minimal wast testing harness in tests/wast.rs, which
runs the wast tests under tests/wast.

It also adds tests for trapping in a variety of ways, and fixes several
bugs exposed by those tests.
2018-12-05 02:25:34 -05:00
Dan Gohman
a6b54330c0 Switch Darwin to use PC-redirection for calling the Unwind function. 2018-12-05 02:25:34 -05:00
Dan Gohman
872f7a10f4 Use MAP_ANON instead of MAP_ANONYMOUS. 2018-12-05 02:25:34 -05:00
Dan Gohman
d5ed424b33 Add tunables.rs. 2018-12-05 02:25:34 -05:00
Dan Gohman
f44fe25f9c Rewrite linear memory handling in terms of simple mmap/VirtualAlloc.
The memmap crate doesn't make it straightforward to have part of the
region be writeable and part readonly. Since this is a fairly boutique
use case, and we don't need all that much code, just use the low-level
APIs directly.

Also, introduce a concept of "tunables" for adjusting the parameters of
the runtime.
2018-12-05 02:25:34 -05:00
Dan Gohman
1b98efd979 Add a README.md for lib/obj. 2018-12-04 18:24:50 -06:00
Dan Gohman
0c8348cfc7 Mention that being usable as a library is a goal. 2018-12-04 18:24:50 -06:00
Dan Gohman
4437bd1742 Add a CODE_OF_CONDUCT.nd and CONTRIBUTING.md. 2018-12-04 18:24:50 -06:00
Dan Gohman
0b039b0978 Mention the goal of prototyping syscalls for proposal to reference-sysroot. 2018-12-04 18:24:50 -06:00
Dan Gohman
3e19b13b0b Fix typo. 2018-12-04 18:24:50 -06:00
Dan Gohman
5af15ce9dd Update the README with project status and goals. 2018-12-04 18:24:50 -06:00
Dan Gohman
990e1386f5 Check for cargo fmt rather than checking for rustfmt directly. 2018-11-30 16:17:21 -08:00
Dan Gohman
02a3684a3f Update to bindgen 0.44. 2018-11-30 09:24:33 -08:00
Benjamin Bouvier
d94e027c2a [build] Move settings generation from Python to Rust code; 2018-11-30 11:05:21 -06:00
Benjamin Bouvier
4c8f1e7a5a [meta] Ignore empty lines to compute indent when parsing multiple lines; 2018-11-30 11:05:21 -06:00
Benjamin Bouvier
12df943409 [meta] Add support to generate Match expressions in Rust; 2018-11-30 11:05:21 -06:00
Benjamin Bouvier
d15e56a9fa Add build warning only if CRANELIFT_VERBOSE is set to anything; 2018-11-30 11:05:21 -06:00
Dan Gohman
4dec8ecfce Check for cargo fmt rather than checking for rustfmt directly. 2018-11-30 10:46:15 -06:00
Frank Rehberger
ec940ee8af Migrating to wabt::wat2wasm (#29)
* Add test_environ_translate

* Migrating to wabt::wat2wasm
2018-11-30 10:44:44 -06:00
Dan Gohman
9947c315b7 Fix Python check script to work outside of Travis. 2018-11-30 06:07:18 -08:00
Dan Gohman
ff25397c9e Fix the type of the heap bound variable. 2018-11-29 19:28:35 -08:00
Dan Gohman
b3d831015c Add basic logging support to the wasmtime binary. 2018-11-29 15:38:12 -08:00
Sergey Pepyakin
5eb43f027a Introduce TranslationContext 2018-11-29 22:28:10 +01:00
Dan Gohman
b7d43edfd3 Be more careful about integer overflow when computing relocs. 2018-11-29 10:28:18 -08:00
Dan Gohman
f7dc961d2c Fix some clippy warnings. 2018-11-29 10:27:49 -08:00
Sergey Pepyakin
52c0443368 Pass function sig in function_body::translate 2018-11-29 18:58:14 +01:00
Dan Gohman
976a5a2e7e Add more trapping testcases. 2018-11-29 06:24:02 -08:00
Dan Gohman
5ae48b06e1 Fix the pthread_detach assert on Darwin. 2018-11-29 06:22:39 -08:00
Dan Gohman
416f8c094d Name Table and Memory's initial field minimum and make it u32.
The spec has switched to calling the "initial" field the "minimum" field
because when linear memory is imported, it may initially be greater than
the "initial" value.

Making it u32 instead of usize will help avoid accidental host-specific
behavior.
2018-11-29 15:03:49 +01:00
Dan Gohman
38acc069fa Fix compilation errors on Darwin. 2018-11-29 06:01:25 -08:00
Dan Gohman
adb76ba9f1 Avoid casting to/from greg_t, which doesn't work consistently across platforms. 2018-11-29 05:59:17 -08:00
Dan Gohman
5e05e9628d Enable OSX builds on Travis. 2018-11-29 05:59:17 -08:00
Dan Gohman
216c0ce14e Fix the scope of the ScopeGuard in call_wasm. 2018-11-29 05:59:17 -08:00
Dan Gohman
869ed1b5c5 Add badges for Appveyor CI and Gitter chat. 2018-11-29 05:58:19 -08:00
Dan Gohman
4ef1bac12b Add a basic appveyor config file. 2018-11-29 05:57:53 -08:00
Dan Gohman
862d859587 Add a LICENSE file to each crate. 2018-11-29 05:57:32 -08:00
Dan Gohman
ba48fd2223 Add TODO comments noting temporary bug workarounds. 2018-11-28 17:18:12 -08:00
Dan Gohman
324c821adf Replace 'mypy --version' with adding '--verbose' to the pip3 install command-line. 2018-11-28 16:46:42 -08:00
Dan Gohman
06d269be63 Disable mypy on OSX on Travis. 2018-11-28 16:36:59 -08:00
Dan Gohman
f8754c2cf8 Fix warnings when the "wasm" feature is disabled. 2018-11-28 16:36:59 -08:00
Dan Gohman
9f7a7fa389 Disable wabt and disassembler features on appveyor for now. 2018-11-28 15:47:54 -08:00
Dan Gohman
eaca8d3f2e Enable OSX in Travis CI. 2018-11-28 15:47:03 -08:00
Dan Gohman
0e601ac4a5 Add an appveyor build badge. 2018-11-28 15:46:31 -08:00