Commit Graph

619 Commits

Author SHA1 Message Date
bors[bot]
7715be9ccb
Merge #1017
1017: Add a 'clear' method to map. r=nlewycky a=nlewycky

# Description
Motivated by work on the `nlewycky/inkwell-lifetimes` branch. No callers yet on master, but we use it on the branch and I'd like to merge in pieces.


Co-authored-by: Nick Lewycky <nick@wasmer.io>
2019-11-25 22:54:12 +00:00
Nick Lewycky
4e2440daec Add a 'clear' method to map. 2019-11-25 14:53:25 -08:00
Patrick Ventuzelo
7ca0430a40 activate pre_validation when llvm backend selected 2019-11-25 13:17:07 +01:00
Mark McCaskey
bb1e7a8d78 Prepare for 0.11.0 release 2019-11-22 11:18:06 -08:00
losfair
5da44c3bf8 Add 'fault' placeholder for Windows. 2019-11-22 07:26:35 +08:00
losfair
8709708de7 Unwind if breakpoint handler returns error. 2019-11-22 01:57:04 +08:00
losfair
4ec4fcf28a Try fixing middleware failure. 2019-11-22 01:46:02 +08:00
losfair
6f3e6fab3b Try fixing compilation on Windows. 2019-11-22 00:51:20 +08:00
losfair
c0ff110ca9 Merge remote-tracking branch 'origin/master' into feature/singlepass-aarch64 2019-11-22 00:38:02 +08:00
losfair
15e3a038ea Try fixing compilation on Windows. 2019-11-22 00:36:34 +08:00
Ivan Enderlin
b1f58bded0 fix(runtime-core) Improve error message when globals are corrupted.
Before this patch:

```
$ cargo run -- run panic_index_oob_all_backends.wasm
Error: ExportNotFound { name: "main" }
```

With this patch:

```sh
$ cargo run -- run panic_index_oob_all_backends.wasm
Error: Can't instantiate module: LinkError([Generic { message: "Trying to read the `0` global that isn\'t properly initialized." }])
```
2019-11-21 10:57:52 +01:00
Ivan Enderlin
a9e446b5cd fix(runtime-core) Fix a panic when generating globals.
Fix https://github.com/wasmerio/wasmer/issues/979.

When we try to get a global that doesn't exist, a panic is
generated. This patch just skip that path, and let a proper error be
generated later.

With this patch, we get:

```sh
$ cargo run -- run panic_index_oob_all_backends.wasm
Error: ExportNotFound { name: "main" }
```

which is kind of the expected behavior in such situation.
2019-11-21 10:51:04 +01:00
losfair
d56fd96395 Merge remote-tracking branch 'origin/master' into feature/singlepass-aarch64 2019-11-20 01:54:34 +08:00
bors[bot]
e8e460ec60
Merge #977
977: fix(runtime-core) Remove unnecessary implementation of `WasmTypeList` r=Hywan a=Hywan

The unit tests `test_func_arity_*` covers all possibilities, from 0 to
12. Removing this specific implementation of `WasmTypeList` for `(A,)`
doesn't break the test cases.

Also, the `impl_traits!` macro already implement `WasmTypeList` for
`(A,)` with `impl_traits!([transparent] S1, A)`. It's not clear why
`rustc` doesn't detect that though.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2019-11-19 14:07:37 +00:00
Ivan Enderlin
dbefa165dc
Merge branch 'master' into fix-runtime-core-clean-up-typed_func 2019-11-19 14:35:11 +01:00
Ivan Enderlin
b856e111b6
Merge branch 'master' into test-runtime-core-typed_func 2019-11-19 14:34:53 +01:00
bors[bot]
e568c4a374
Merge #972
972: Prepare for 0.10.2 release r=MarkMcCaskey a=MarkMcCaskey



Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-11-18 19:44:33 +00:00
losfair
23f03f555b Fix compilation failure in tiering.rs. 2019-11-18 23:10:49 +08:00
Ivan Enderlin
f6cb6ce286 fix(runtime-core) Remove a warning for unused_parens.
The behavior of `unused_parens` has changed since Rust 1.39. A warning
is then raised. This patch fixes that.
2019-11-18 12:44:40 +01:00
Ivan Enderlin
85a53e8e1f test(runtime-core) Test closures in Func::new. 2019-11-18 12:44:00 +01:00
Ivan Enderlin
4e42fa1e48 fix(runtime-core) Remove unnecessary implementation of WasmTypeList.
The unit tests `test_func_arity_*` covers all possibilities, from 0 to
12. Removing this specific implementation of `WasmTypeList` for `(A,)`
doesn't break the test cases.

Also, the `impl_traits!` macro already implement `WasmTypeList` for
`(A,)` with `impl_traits!([transparent] S1, A)`. It's not clear why
`rustc` doesn't detect that though.
2019-11-18 12:22:17 +01:00
losfair
1db6425cd5 Merge remote-tracking branch 'origin/master' into feature/singlepass-aarch64 2019-11-17 04:36:22 +08:00
anb
3b2d751c55 Enable compilation for specific target
By exposing the target information through `CompilerConfig`,
compiler(only LLVM at the moment) could create a machine with
different CPU feature flags other than current host, which makes it
capable to "cross compile" to some degree.

Update #959
2019-11-15 18:51:59 -08:00
Mark McCaskey
cebcb4c927 Prepare for 0.10.2 release 2019-11-15 14:55:53 -08:00
losfair
a9c89eb1a8 Merge remote-tracking branch 'origin/master' into feature/singlepass-aarch64 2019-11-14 23:46:15 +08:00
bors[bot]
fff16c08d0
Merge #965
965: Add categories and keywords to `Cargo.toml`s r=MarkMcCaskey a=MarkMcCaskey



Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-11-13 23:47:56 +00:00
Mark McCaskey
9127eaf825 Add categories and keywords to Cargo.tomls 2019-11-13 15:46:09 -08:00
Ivan Enderlin
c4dffd6f59 doc(runtime-core) Fix typos. 2019-11-13 15:55:45 +01:00
Ivan Enderlin
7b809a765f doc(runtime-core) Improve documentation of func!.
This patch explains that `func!` can consume closures.
2019-11-13 15:54:41 +01:00
Ivan Enderlin
82e4d8e6cc feat(runtime-core) func! supports closures.
This patch allows to write:

```rs
func!(|…| -> … { … })
```
2019-11-13 15:54:09 +01:00
Ivan Enderlin
8f20a28ab1
Merge branch 'master' into feat-runtime-core-field-offset 2019-11-13 13:22:41 +01:00
losfair
605ada7ad7 Run cargo fmt. 2019-11-13 14:53:34 +08:00
losfair
08a1dd3e8c Merge master and add documentation. 2019-11-13 14:52:22 +08:00
losfair
f1339b4033 Fix known_registers size. 2019-11-13 01:00:27 +08:00
Ivan Enderlin
a1e8a8f0db fix(runtime-core) Same bug with field-offset as before.
It will be fixed in a following PR.
2019-11-12 15:17:36 +01:00
Ivan Enderlin
0775d496d3 feat(runtime-core) Replace the field-offset crate by a custom offset_of! macro.
The `field-offset` crate is unmaintained. When using its `offset_of!`
macro on a struct with a field of type `std::ptr::NonNull`, in release
mode, it generates a sigill.

This patch removes the `field-offset` crate, and implements a custom
`offset_of!` macro.
2019-11-12 15:12:31 +01:00
Ivan Enderlin
89859a9ab5 Merge branch 'master' into feat-runtime-core-clos-host-function 2019-11-12 14:36:33 +01:00
Ivan Enderlin
0de7f4fd0b test(runtime-core) offset_of! fails with a struct containing NonNull types.
It fails only in release mode. That's a bug from the `field-offset`
crate. This patch is a temporary fix.
2019-11-12 14:34:55 +01:00
Mark McCaskey
69950d9e5f Prepare for 0.10.1 release 2019-11-11 16:22:37 -08:00
Ivan Enderlin
22abd8efdc doc(runtime-core) Add missing doc on vm::FuncCtx. 2019-11-12 01:10:32 +01:00
Ivan Enderlin
95706160ee Merge branch 'master' into feat-runtime-core-clos-host-function 2019-11-12 00:55:40 +01:00
Ivan Enderlin
06c6b3c8e8 feat(runtime-core) More ABI compatible definition of Func and FuncEnv. 2019-11-12 00:52:14 +01:00
Ivan Enderlin
11f34a9285 feat(clif-backend,singlepass-backend) Feed imported functions with FuncCtx.vmctx. 2019-11-12 00:51:57 +01:00
Ivan Enderlin
98e4ef066a feat(runtime-core) Feed imported functions with vm::Ctx again.
… and look for the associated `vm::FuncCtx`. This way, we don't break
the rule: “all functions receive a vmctx pointer as first argument.”.
2019-11-12 00:50:25 +01:00
Mark McCaskey
0a216c0779 Prepare for 0.10.0 release 2019-11-11 12:13:53 -08:00
Brandon Fish
a74acb7a8a Add missing rustdoc for macro debug 2019-11-10 16:28:33 -06:00
Brandon Fish
ea3b6fa6d7 Add missing rustdocs for Windows code 2019-11-10 16:03:43 -06:00
Brandon Fish
82ec5e970a Add additional rustdocs for missing docs found during CI 2019-11-10 15:16:07 -06:00
Brandon Fish
2d00b2589e Update with PR review suggestions 2019-11-10 14:37:36 -06:00
Brandon Fish
1f9316b5ae Update Protect enum with suggestions 2019-11-10 14:31:36 -06:00