Commit Graph

26 Commits

Author SHA1 Message Date
Artur Jamro
fad70eb8bb Refactor usage of SecondaryMap impls (serde, PartialEq) 2019-09-05 17:14:32 -07:00
Artur Jamro
364300f6cf Use target triple in cache directory hierarchy (#300) 2019-09-04 13:12:27 -07:00
Dan Gohman
45fd9dadd8 Use winapi::ctypes::c_void on Windows. (#297)
`winapi::ctypes::c_void` is apparently distinct from `core::ffi::c_void`
and `libc::c_void`.
2019-08-24 07:04:31 -07:00
Dan Gohman
d4f27dcc91 Update Cargo.toml metadata for publishing. 2019-08-20 23:28:54 -07:00
Dan Gohman
44367ba99a Bump version to 0.2.0 2019-08-20 16:07:57 -07:00
Artur Jamro
7009c8dd73 Add dyn to traits and bump Rust version 2019-08-16 13:46:09 -07:00
Alex Crichton
6def6de5e0 Remove the LLVM/bindgen/cmake dependencies from wasmtime-runtime (#253)
* Remove cmake/bindgen/llvm from wasmtime-runtime

This commit removes the cmake/bindgen dependency (which removes the need
for `llvm-config`) from the `wasmtime-runtime` crate. The C++ code is
instead compiled with the `cc` crate (it's just one file anyway) and the
interface is handwritten since it's quite small anyway.

Some other changes are:

* The `TrapContext` type in C++ was removed since it was unused, and it
  was moved to Rust with a `Cell` on each field.

* Functions between Rust/C++ now return `int` instead of `bool` to make
  them a bit more FFI compatible portably.

* The `jmp_buf` type has a workaround that will be fixed in the next commit.

* Move setjmp/longjmp to C++

This commit moves the definition of setjmp and longjmp into C++. This is
primarily done because it's [debatable whether it's possible to call
`setjmp` from Rust][rfc]. The semantics of `setjmp` are that it returns
twice but LLVM doesn't actually know about this because rustc isn't
telling LLVM this information, so it's unclear whether it can ever be
safe.

Additionally this removes the need for Rust code to know the definition
of `jmp_buf` which is a pretty hairy type to define in Rust across
platforms.

The solution in this commit is to move all setjmp/longjmp code to C++,
and that way we should be able to guarantee that jumps over wasm JIT
code should always go from C++ to C++, removing Rust from the equation
for now from needing to get any fiddly bits working across platforms.
This should overall help it be a bit more portable and also means Rust
doesn't have to know about `jmp_buf` as a type.

The previous `Vec` of `jmp_buf` is now replaced with one thread-local
pointer where previous values are stored on the stack and restored when
the function returns. This is intended to be functionally the same as
the previous implementation.

[rfc]: https://github.com/rust-lang/rfcs/issues/2625

* rustfmt

* Use volatile loads/stores

* Remove mention of cmake from README
2019-08-09 10:11:13 +02:00
Yury Delendik
5fc2d827b7 Update cranelift requirement from 0.37.0 to 0.38.0 (#254)
closes #248, closes #249, closes #250, closes #251, closes #252
2019-08-06 14:49:28 -05:00
Yury Delendik
0bc9d1fe6f Update cranelift to 0.37.0 (#236)
Closed #228, #227, #226, #225, #224
2019-08-01 20:46:34 -05:00
dependabot-preview[bot]
320ad7d4b3 Update bindgen requirement from 0.50.0 to 0.51.0 (#222)
Updates the requirements on [bindgen](https://github.com/rust-lang/rust-bindgen) to permit the latest version.
- [Release notes](https://github.com/rust-lang/rust-bindgen/releases)
- [Changelog](https://github.com/rust-lang/rust-bindgen/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/rust-bindgen/compare/v0.50.0...v0.51.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-31 11:40:10 -05:00
Artur Jamro
165dc4944d Simple module compilation cache (#203)
* Simple module compilation cache

* Fix base64 encoding bug

* Use warn! everywhere in cache system

* Remove unused import

* Temporary workaround for long path on Windows

* Remove unused import for non-windows builds

* Add command line argument to enable cache system + apply minor review feedback
2019-07-25 16:16:10 -07:00
dependabot-preview[bot]
dc39fee390 Update bindgen requirement from 0.49.0 to 0.50.0
Updates the requirements on [bindgen](https://github.com/rust-lang/rust-bindgen) to permit the latest version.
- [Release notes](https://github.com/rust-lang/rust-bindgen/releases)
- [Changelog](https://github.com/rust-lang/rust-bindgen/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/rust-bindgen/compare/v0.49.0...v0.50.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-23 11:04:45 -07:00
dependabot-preview[bot]
9fe77cffc6 Update memoffset requirement from 0.2.1 to 0.5.1
Updates the requirements on [memoffset](https://github.com/Gilnaa/memoffset) to permit the latest version.
- [Release notes](https://github.com/Gilnaa/memoffset/releases)
- [Commits](https://github.com/Gilnaa/memoffset/commits/v0.5.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-23 11:04:06 -07:00
Artur Jamro
c80508c8a9 Make the calls to wasm's memory.grow and memory.size indirect (#194)
* Make the calls to wasm's memory.grow and memory.size indirect
2019-07-18 14:40:03 -07:00
Dan Gohman
1a10f4a002 Update to Cranelift 1.33 and require Rust 1.35.
Cranelift requires Rust 1.35; update accordingly.
2019-07-03 11:16:55 -07:00
Yury Delendik
fb9d6061e4 Update cranelift, faerie, target-lexicon and wasmparser deps 2019-07-02 14:07:30 -07:00
Dan Gohman
e3c021cc59 Downgrade memoffset to 0.2.1.
Version 0.3.0 was yanked from crates.io.
2019-07-02 13:27:03 -07:00
Ari Lotter
8dc1d90352 Use try_from replacing cast in wasmtime-runtime. 2019-06-09 12:27:28 +02:00
Dan Gohman
825f1d764a Fix a compiler warning.
Fix the following warning from Rust 1.35:

warning: cannot borrow `*self` as mutable because it is also borrowed as immutable
   --> wasmtime-runtime/src/instance.rs:473:25
    |
465 |         } else if let Some(start_export) = self.module.exports.get("_start") {
    |                                            ----------- immutable borrow occurs here
...
473 |                         self.invoke_function(*func_index)
    |                         ^^^^                 ----------- immutable borrow later used here
    |                         |
    |                         mutable borrow occurs here
    |
    = note: #[warn(mutable_borrow_reservation_conflict)] on by default
    = warning: this borrowing pattern was not meant to be accepted, and may become a hard error in the future
    = note: for more information, see issue #59159 <https://github.com/rust-lang/rust/issues/59159>
2019-05-30 18:44:38 -07:00
Yury Delendik
6740704b74 Expose Module reference from InstanceHandle 2019-05-14 15:02:06 -07:00
Stefano Buliani
3351befb3b Allow access to memory_index and grow on Instance (#105)
* Changed `memory_grow` and `memory_index` in `Instance` struct to be `pub(crate)` and added the equivalent proxy methods to the `InstanceHandle` struct.
2019-04-16 19:59:54 -07:00
Yury Delendik
07a6ca8f4e Hack to not allow inlining even when Rust wants to do it in release mode. 2019-04-10 11:15:38 -07:00
Henrik Rydgård
f5ebdb8e6a Get wasmtime building on Windows. (#92)
* Get wasmtime building on Windows.

Requires LLVM binaries from http://releases.llvm.org/download.html at
build time (bindgen).
2019-04-03 06:50:38 -07:00
Dan Gohman
b2fefe7714 WASI prototype design, implementation, and documentation.
This adds documents describing the WASI Core API, and an implementation in
Wasmtime.
2019-03-27 10:58:43 -07:00
Yury Delendik
2353be95e6 update cranelift deps to 0.30.0 2019-03-27 02:24:51 -07:00
Dan Gohman
db0abe8431 Move the wasmtime crate directories form lib/* to wasmtime-*.
This follows a similar change to Cranelift made here:

https://github.com/CraneStation/cranelift/pull/660
2019-03-20 11:30:28 -07:00