Commit Graph

6452 Commits

Author SHA1 Message Date
Marcin Mielniczuk
9f840ff6f1 Quick & dirty misc_testsuite 2019-08-23 20:36:11 -07:00
Artur Jamro
479592f8c5 Cache compression (#234) 2019-08-23 16:39:46 -07:00
Andrew Brown
cc57e84cbd Fix segfault due to b64 encoding (#919)
* Fix segfault due to b64 encoding

Prior to this patch, bconst.b64 encoded its instruction with a 32-bit immediate that caused improper decoding of the MOV instruction; instead, use a REX prefix and rely on zero-extension of the immediate. Fixes #911.
2019-08-23 18:04:34 +02:00
Joshua Nelson
1eb6cd93b2 Fix documentation typo
function -> data object
2019-08-23 15:52:49 +02:00
Marcin Mielniczuk
9950bddee5 Use safe casts in path_filestat_set_times on unix. 2019-08-23 13:02:21 +02:00
Yaron Wittenstein
18ecf60ad5 cranelift-wasm: bump wasmparser version to 0.37.0 2019-08-23 11:38:25 +02:00
Sendil Kumar
69d60c4711 update nix version 2019-08-23 09:24:38 +02:00
Artur Jamro
d3815a0399 Implement serde and equality traits for SecondaryMap 2019-08-22 15:54:10 -07:00
Sean Stangl
e736367b8c Make fold_redundant_jumps() feature-gated on basic-blocks 2019-08-22 18:54:49 +02:00
Mike Hommey
97996d79ce Sort custom_legalizes for more deterministic generated code
For better caching.
2019-08-22 11:44:19 +02:00
Dan Gohman
e7f67b1725 Format with rustfmt. (#26)
This will allow us to update the lightbeam version in Wasmtime.
2019-08-22 10:33:41 +02:00
Andrew Brown
ff3c44385c Add test run to cranelift-filetests to allow executing CLIF (#890)
* Add ability to run CLIF IR using `clif-util run [-v] {file}` and add `test run` to cranelift-filetests to allow executing CLIF

This re-factors the compile/execute parts to a FunctionRunner that is shared between cranelift-filetests and clif-util. CLIF can be now be run using `clif-util run` as well as during `clif-util test` for files with a `test run` header. As before, only functions suffixed with a `run` comment are executed. The `run: fn(...) == ...` expression syntax is left for a subsequent change.
2019-08-21 18:03:09 +02:00
Benjamin Bouvier
276bb5e26d Fixes #877: Remove appveyor configuration and badge;
See #877: there's an attempt to switch to Azure Pipelines.
2019-08-21 06:34:27 -07:00
Marcin Mielniczuk
1bf5106f40 Implement path_filestat_get & path_filestat_set_times on Windows. 2019-08-21 13:20:40 +02:00
Marcin Mielniczuk
2ed69b1d10 Add .concatenate() method to PathGet on Windows. 2019-08-21 13:20:40 +02:00
Mark Bestavros
d93673508c cranelift-codegen: Remove all default architecture support 2019-08-21 11:33:39 +02:00
Marcin Mielniczuk
7a991921bf Add the test for path_filestat_* 2019-08-21 09:57:35 +02:00
Yury Delendik
f88e92a57c Better Wasmtime API for embedder (#287)
* Migrate wasm-rust-api code to wasmtime.
2019-08-21 00:35:26 -07:00
Dan Gohman
d7883dd60a Don't publish misc_testsuite/*.wasm. 2019-08-21 00:04:00 -07:00
Dan Gohman
eb90f76b42 Add #![cfg(windows)] to allow publishing from non-Windows hosts. 2019-08-21 00:04:00 -07:00
Dan Gohman
19055d0178 Add description fields. 2019-08-21 00:04:00 -07:00
Jakub Konka
cf0bef84cc Fix filestat_from_nix conversion fn 2019-08-20 23:38:53 -07:00
Dan Gohman
8ea883a603 Workaround a rounding difference in the strtof function in Centos 6. (#290)
* 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.
2019-08-20 23:29:19 -07:00
Dan Gohman
b2b2612305 Topologically sort package ordering in publish-all.sh. 2019-08-20 23:28:54 -07:00
Dan Gohman
2c4118a694 Update for Cranelift 0.40 API changes. 2019-08-20 23:28:54 -07:00
Dan Gohman
d4f27dcc91 Update Cargo.toml metadata for publishing. 2019-08-20 23:28:54 -07:00
Dan Gohman
f37b672c8d Update the pinned wasmtime revision.
This resynchronizes the versions of cranelift used in wasi-common
and wasmtime to 0.40.
2019-08-21 07:46:18 +02:00
Dan Gohman
6921782fbf Add license declarations to headers. 2019-08-20 16:17:36 -07:00
Dan Gohman
500bf83082 Update to latest cranelift and target-lexicon. 2019-08-20 16:17:36 -07:00
Dan Gohman
44367ba99a Bump version to 0.2.0 2019-08-20 16:07:57 -07:00
Dan Gohman
13f83d8291 Bump version to 0.40.0 2019-08-20 15:32:19 -07:00
Dan Gohman
fbfeaaa32b Revert the test changes too.
In 1169dc520815fa4a6b1285914748408729a28caa, I forgot to git add the
test file changes.
2019-08-20 15:26:52 -07:00
Dan Gohman
291afaf4ad Temporarily disable fold_redundant_jumps.
See #916 for details.
2019-08-20 15:14:28 -07:00
Dan Gohman
0d54517d35 Bump version to 0.39.0 2019-08-20 14:26:16 -07:00
Yury Delendik
b4a505d5d3 Generate simulated DWARF for rest of the functions 2019-08-20 14:24:13 -07:00
Dan Gohman
0c2c597852 Update to latest versions of term, capstone, wabt, goblin, wasmparser. 2019-08-20 14:18:14 -07:00
Andrew Brown
b4ef90cfcd Remove SSE2 setting for x86
In talking to @sunfishcode, he preferred to avoid the confusion of more ISA predicates by eliminating SSE2. SSE2 was released with the Pentium 4 in 2000 so it is unlikely that current CPUs would have SIMD enabled and not have this feature. I tried to note the SSE2-specific instructions with comments in the code.
2019-08-20 10:21:12 -07:00
Andrew Brown
6605f308b3 Fix static analysis warnings 2019-08-20 10:21:12 -07:00
Andrew Brown
d492cf7e0e Avoid unnecessary lane calculations in codegen code
This refactor moves the calculation of the number of lanes to code closer to where the Instruction/BoundInstruction is bound.
2019-08-20 10:21:12 -07:00
Andrew Brown
3fdc78174f Add x86 implementation of extractlane instruction 2019-08-20 10:21:12 -07:00
Benjamin Bouvier
036b9aea94 [codegen] Rename and explicit usage of replace_with_alias;
It can actually only replace one result; don't try to make it generic
yet, since there's no point in doing so right now, and make it do the
dumb thing so it's not surprising to use.
2019-08-20 19:06:09 +02:00
Marcin Mielniczuk
065fbea252 Implement path_filestat_set_times using nix instead of libc.
As advised in #16.
2019-08-20 17:28:25 +02:00
Dan Gohman
4937dd0632 Fix the name of the wast command in its usage string. 2019-08-19 16:58:33 -07:00
Artur Jamro
c3215f4f1b Tests for cache system 2019-08-19 16:56:29 -07:00
Dan Gohman
697fa59b55 Remove broken links in README.md. 2019-08-19 12:53:31 -07:00
Artur Jamro
3c33fe63a1 Add command line option for custom cache directory 2019-08-19 11:29:52 -07:00
dependabot-preview[bot]
7dc81cbbc0 Update wabt requirement from 0.8 to 0.9
Updates the requirements on [wabt](https://github.com/pepyakin/wabt-rs) to permit the latest version.
- [Release notes](https://github.com/pepyakin/wabt-rs/releases)
- [Commits](https://github.com/pepyakin/wabt-rs/compare/0.8.0...0.9.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-19 11:23:49 -07:00
Alex Crichton
d1b1500d19 Add an example #[wasmtime] Rust macro (#283)
This commit adds a `wasmtime-rust` crate to the `misc` folder next to
the previously added Python extension. The intention is that this
showcases loading a WebAssembly file natively in Rust and how with an
attribute macro it can feel lightweight in terms of boilerplate.

The macro itself is pretty non-featureful today beyond the bare bones to
get anything working, but there's all sorts of possibilities like
JIT-compiled entry stubs we could eventually do with all the type
information!
2019-08-19 19:45:42 +02:00
Dan Gohman
54dd085e27 Add a default-run, so that "cargo run" doesn't need a --bin option.
default-run is a new feature in Rust 1.37.
2019-08-19 05:55:27 -07:00
Alex Crichton
af2b4e4946 Add initial support for WebAssembly Interface Types (#282)
This commit adds initial support for [WebAssembly Interface
Types][proposal] to wasmtime. This is all intended to be quite
experimental, so experimental in fact that even the name of the
[proposal] is still in flux. (this has otherwise been known as "host
bindings" or "webidl bindings" or "wasm bindings").

The goal of this commit is to start adding support the wasmtime set of
crates for WebAssembly Interface Types. A new `wasmtime-interface-types`
crate has been added with very basic support for dynamically invoking
and inspecting the various bindings of a module. This is in turn powered
by the `wasm-webidl-bindings` crate which is shared with the
`wasm-bindgen` CLI tool as a producer of this section.

Currently the only integration in `wasmtime`-the-binary itself is that
when passed the `--invoke` argument the CLI will now attempt to invoke
the target function with arguments as parsed from the command line
itself. For example if you export a function like:

    fn render(&str) -> String

Then passing `--invoke render` will require one argument on the command
line, which is the first argument as a string, and the return value is
printed to the console. This differs from today's interpretation of
`--invoke` where it is a failure if the invoked function takes more than
one argument and the return values are currently ignored.

This is intended to also be the basis of embedding wasmtime in other
contexts which also want to consume WebAssembly interface types. A
Python extension is also added to this repository which implements the
`wasmtime` package on PyPI. This Python extension is intended to make it
as easy as `pip3 install wasmtime` to load a WebAssembly file with
WebAssembly Interface Types into Python. Extensions for other languages
is of course possible as well!

One of the major missing pieces from this is handling imported functions
with interface bindings. Currently the embedding support doesn't have
much ability to support handling imports ergonomically, so it's intended
that this will be included in a follow-up patch.

[proposal]: https://github.com/webassembly/webidl-bindings

Co-authored-by: Yury Delendik <ydelendik@mozilla.com>
2019-08-19 13:32:13 +02:00