5129 Commits

Author SHA1 Message Date
Mark McCaskey
c295adbaa8 Prepare for 0.15.0 release 2020-03-04 12:26:19 -08:00
bors[bot]
3b09d0ffac
Merge #1267
1267: Improve support for preopened directories in WASI syscalls r=MarkMcCaskey a=MarkMcCaskey

Ported over from #1263 

# Description
<!-- 
Provide details regarding the change including motivation,
links to related issues, and the context of the PR.
-->

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
2020-03-04 19:54:05 +00:00
Mark McCaskey
69fd76af10 Improve support for preopened directories in WASI syscalls
Also filters our default logging more and improves some debug statements
2020-03-04 11:51:24 -08:00
bors[bot]
b2e6535aa0
Merge #1264
1264: feat(interface-types) Implement lifting and lowering instructions r=Hywan a=Hywan

For the moment, WIT defines [a bunch of lifting and lowering instructions](https://github.com/WebAssembly/interface-types/blob/master/proposals/interface-types/working-notes/instr.md). The encoders, the decoders and the AST support them, but we didn't have any instruction implementations for them. This PR implements the instructions for real.

To handle casting failure, I decided to use the `TryFrom` trait, instead of `as`, such as:

```rust
let x: i32 = 128;
let y: i8 = x.try_into().unwrap(); // fails
```

while:

```rust
let x: i32 = 128;
let y: i8 = x as _; // just overflows silently
```

Not all `*x` instructions aren't implement _yet_.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2020-03-04 13:43:33 +00:00
bors[bot]
973154cf33
Merge #1265
1265: Improve `WasmPtr` documentation r=MarkMcCaskey a=MarkMcCaskey

This came up multiple times when responding to people on our issue tracker.

Adds an example and a lot more information about `WasmPtr` and `ValueType`


Co-authored-by: Mark McCaskey <mark@wasmer.io>
2020-03-04 01:05:31 +00:00
Mark McCaskey
4a6c96382d Update wording of doc comment from feedback 2020-03-03 17:04:52 -08:00
Mark McCaskey
469e43312a Improve WasmPtr documentation 2020-03-03 16:16:29 -08:00
bors[bot]
22d2031943
Merge #1217
1217: Polymorphic host functions based on dynamic trampoline generation. r=losfair a=losfair

This PR implements polymorphic host functions by dynamically generating the "glue" code that translates platform arguments to an array in `runtime-core`.

TODO:

- ~~Multiple return values.~~ Deferring to a future multivalue PR.
- [x] Dynamic signatures for polymorphic functions.
- [x] Use a proper executable memory allocator.

Co-authored-by: losfair <zhy20000919@hotmail.com>
Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
Co-authored-by: Heyang Zhou <zhy20000919@hotmail.com>
2020-03-03 18:00:42 +00:00
losfair
f499dea0a7 Merge remote-tracking branch 'origin/master' into feature/polymorphic-v2 2020-03-04 01:56:52 +08:00
losfair
d9e744d9dc Resolve review comments. 2020-03-04 01:56:48 +08:00
Ivan Enderlin
de53659ee7 feat(interface-types) Implement s64-to-i32x and u64-to-i32x
Actually, `s64-to-i32` and `u64-to-i32` already error when overflow
happens.
2020-03-03 17:17:26 +01:00
Ivan Enderlin
c157bdaf63 test(interface-types) Test when lowering or lifting fails because of the value. 2020-03-03 17:10:10 +01:00
Ivan Enderlin
6576dfd64b test(interface-types) Add test cases for errors. 2020-03-03 17:04:26 +01:00
Ivan Enderlin
30e72eb796 feat(interface-types) Implement lifting and lowering instructions. 2020-03-03 16:57:05 +01:00
bors[bot]
115a6573a9
Merge #1261
1261: Fix our side of wasmparser typo. r=MarkMcCaskey a=nlewycky

This is a `cargo update` plus change to fix for ac6df05378 .


Co-authored-by: Nick Lewycky <nick@wasmer.io>
2020-03-02 21:53:13 +00:00
bors[bot]
d2b546fef5
Merge #1260
1260: Recognize FreeBSD r=syrusakbary a=MikaelUrankar



Co-authored-by: MikaelUrankar <mikael.urankar@gmail.com>
2020-03-02 19:27:56 +00:00
Nick Lewycky
d5581331a2 Fix our side of wasmparser typo. 2020-03-02 11:16:21 -08:00
Syrus Akbary
e207c7f17d
Update LICENSE 2020-03-02 11:08:21 -08:00
MikaelUrankar
48fcc8af09 Recognize FreeBSD 2020-03-02 15:41:41 +01:00
Syrus Akbary
51084ec8fb
Update README.md 2020-02-29 09:47:00 -08:00
Syrus Akbary
5d55c69441
Update README.md 2020-02-29 09:41:31 -08:00
Syrus Akbary
2fe2bb9070
Update README.md 2020-02-29 09:39:53 -08:00
Syrus Akbary
b7231775bc
Update README.md 2020-02-29 09:36:41 -08:00
Syrus Akbary
527ac41415
Small improvements to README 2020-02-29 09:35:45 -08:00
Syrus Akbary
d647ac3023
Merge pull request #1252 from wasmerio/wasi-mapdir
Allow / in mapdir wasm path
2020-02-29 09:17:00 -08:00
Syrus
f8b206d438 Added changes into changelog 2020-02-29 08:49:38 -08:00
Syrus
7a88a320c7 Allow / in mapdir wasm path 2020-02-29 08:47:25 -08:00
Syrus
3f456db4ad Updated headers 2020-02-29 08:45:48 -08:00
Syrus
4c19cd65e8 Add capi in ARM 2020-02-29 08:45:24 -08:00
losfair
d443ad8d40 Remove outdated comment. 2020-02-29 11:15:09 +08:00
losfair
4012645aee Fix CodeMemory doc comments. 2020-02-29 11:13:34 +08:00
losfair
84179dbd5e Fix changelog. 2020-02-29 11:12:26 +08:00
Syrus
80f7e98651 Moved build wapm into Makefile 2020-02-28 11:11:31 -08:00
bors[bot]
85a3bb7148
Merge #1244
1244: feat(interface-types) Update to last standard version r=MarkMcCaskey a=Hywan

WIP

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2020-02-28 18:35:28 +00:00
losfair
2ddf9ad4c8 Disallow "fat" closures. 2020-02-28 22:16:29 +08:00
losfair
6516243e8a Merge remote-tracking branch 'origin/master' into feature/polymorphic-v2 2020-02-28 11:54:13 +08:00
losfair
31a72e59fb Rename ErasedFunc to DynamicFunc and fix leaky PolymorphicContext. 2020-02-28 11:41:36 +08:00
bors[bot]
a13a897495
Merge #1212
1212: Add support for GDB JIT debugging r=MarkMcCaskey a=MarkMcCaskey

This PR adds support for JIT debugging to Wasmer with the Cranelift backend using a fork of `wasmtime-debug`.

The motivation for this change is partially inspired by the feature in Wasmtime and the implementation is largely derived from Wasmtime's `wasmtime-debug` crate and not included in this PR.  This implementation is currently Cranelift-only (if LLVM has value tracking we can add this there too without too much effort; we'd have to do the value tracking ourselves in Singlepass and I don't have enough context to know how hard that would be) and is based on a generic fork of the `wasmtime-debug` -- which will be published and uploaded in another repo.

This PR started out implementing the [Wasm-DWARF](https://yurydelendik.github.io/webassembly-dwarf/) reading and writing with gimli but after working on it for a few days, reading a chunk of the DWARF spec, seeing that Wasmtime had solved this well, and realizing how long this would likely take, I decided that it didn't make sense to spend the engineering effort there so I made a copy of `wasmtime-debug` and removed some of the less portable Cranelift pieces (very minor changes) and all code relying on data structures from wasmtime.  The resulting crate is completely generic and would work fine with Wasmtime or any other Wasm runtime at the cost of requiring some `transmute`s or a linear pass over the debug data to reconstruct it in terms of the new types exposed by the fork.  Perhaps there's a cleaner way to handle that that I haven't considered.

The integration with the GDB JIT interface is from the LLVM examples (I don't remember if I properly attributed everything in this PR/version of the code -- I still have the other branches locally though which I'll review before shipping this) and some of the code in this PR is from Wasmtime/Cranelift source code such as the sorting of the `ebb`s in `clif_backend::resolver`.  I spent a long time debugging some subtle bugs and ended up using a few things from Wasmtime's integration with `wasmtime-debug` and some bits from `cranelift-wasm` and `cranelift-codegen`.

If there's interest from other people in working on the generic `wasmtime-debug` fork, I'm happy to get other maintainers involved and/or move it to a shared organization.

Special thanks to [Yury Delendik](https://github.com/yurydelendik) and the other `wasmtime-debug` authors for their work on Wasm debugging.  Also shout out to Cranelift for the nice API for tracking variables/data.

### TODO:
- [x] Update attributions file for LLVM, [wasm-dwarf](https://github.com/yurydelendik/wasm-dwarf), and Wasmtime/Cranelift and do another pass over code to make sure we're in compliance with the licenses from the relevant projects and have properly attributed the code used from other projects.
- [x] Adjust API of wasm-debug based on feedback
- [x] Discuss with Nick integration with LLVM
- [x] Discuss with Heyang integration with Singlepass
- [x] Adjust implementation based on feedback from team (traits modified, etc.)
- [x] Clean up some pointer wrangling code
- [x] Add opt-in feature to wasmer-runtime-core to enale wasm-debug so library users who won't use debug info are not affected

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Mark McCaskey <5770194+MarkMcCaskey@users.noreply.github.com>
2020-02-27 22:23:22 +00:00
Mark McCaskey
91808b9df2 Update test-rest to explicitly test each crate 2020-02-27 14:22:26 -08:00
losfair
32915f0077 Merge remote-tracking branch 'origin/master' into feature/polymorphic-v2 2020-02-27 23:49:10 +08:00
Mark McCaskey
0593965459 Make gdb jit symbol weak linking default in llvm-backend features 2020-02-26 19:41:53 -08:00
Mark McCaskey
b5cbb9df60 Fix test and build for musl 2020-02-26 19:07:30 -08:00
Mark McCaskey
dbb2ececf8 Work around unstable linkage attribute 2020-02-26 18:32:40 -08:00
Mark McCaskey
a089cf5a0c Link GDB JIT exposed global and fn as "linkonce"
This is required because LLVM exposes its own
2020-02-26 18:05:24 -08:00
Mark McCaskey
3691c80b7d Add generate_debug_info field to test 2020-02-26 17:29:18 -08:00
Mark McCaskey
0c8464e3bc Update changelog entry for gdb jit PR 2020-02-26 16:59:10 -08:00
Mark McCaskey
56e47c17b0 Revert Wasm parsing to improved old style, fixing singlepass 2020-02-26 16:35:25 -08:00
Mark McCaskey
cb20cd9b2d Merge branch 'master' into feature/debug-prototype2 2020-02-26 14:39:02 -08:00
Syrus Akbary
73370b9de9
Merge pull request #1250 from wasmerio/feature/update-wasmparser
Update wasmparser to 0.51.3 and clif forks to 0.59
2020-02-26 14:05:27 -08:00
Mark McCaskey
a8b4f2a1e4 Update clif option string, fix table parsing to match AnyFunc 2020-02-26 13:25:41 -08:00