660 Commits

Author SHA1 Message Date
Syrus
661df38cf2 Use blake3 instead of blake2_simd 2020-01-13 11:58:31 +01:00
Ivan Enderlin
9b2f0fc635 chore(runtime-core) Avoid code duplication. 2020-01-10 10:15:26 +01:00
Ivan Enderlin
c81e49a091 feat(runtime-core) Replace missing host function by always_trap. 2020-01-09 15:12:09 +01:00
Ivan Enderlin
6018aa32e1 fix(runtime-core) Drop vm::FuncCtx if not null. 2020-01-09 15:11:51 +01:00
Ivan Enderlin
19c3837881 feat(runtime-core) Create the always_trap host function. 2020-01-09 15:10:53 +01:00
Syrus
ad82beffb4 Fixed tests 2019-12-20 21:11:55 -08:00
Syrus
a7764a6fd6 Simplified code 2019-12-20 20:49:32 -08:00
Syrus
1a960a01ae Improved lint 2019-12-20 20:45:10 -08:00
Syrus
c4d70a6b75 Use Arc instead of Rc 2019-12-20 20:37:47 -08:00
Syrus
097353d0d4 Fix lint 2019-12-20 19:20:32 -08:00
Syrus
0f45bd4f0d Fixed tiering docs 2019-12-20 19:12:35 -08:00
Syrus
2404203ae4 Improved based on feedback 2019-12-20 19:03:49 -08:00
Syrus
294cc28135 Move inline breakpoint outside of runtime backend
There was some code smell leaking inline breakpoint implementation into the runtime core backend instead of the compiler itself
2019-12-20 18:26:56 -08:00
Mark McCaskey
fe969be612 Update wasmparser to version 0.45.0 2019-12-20 17:16:54 -08:00
Stephan Renatus
782be5b51a Add function to get nul-terminated strings from memory
Fixes #1086.

Signed-off-by: Stephan Renatus <srenatus@chef.io>
2019-12-20 21:53:08 +01:00
Mark McCaskey
ad8945a555 Add misc doc link fixes and update old comment 2019-12-19 16:22:51 -05:00
Mark McCaskey
6a74b7e994 Prepare for 0.12.0 release 2019-12-18 17:24:29 -05:00
Stephan Renatus
b5b8484f6a docs: fix markup runtime-core docs
Signed-off-by: Stephan Renatus <srenatus@chef.io>
2019-12-18 15:06:46 +01:00
Jasper-Bekkers
22b3a06b40 Skip formatting test_func_arity_n! invocations with more then 15 parameters 2019-12-18 13:22:22 +01:00
Jasper-Bekkers
ee2e595e5b Add more parameters to Func 2019-12-18 12:36:19 +01:00
Mark McCaskey
13b097e8c3 Improve the wording of typed index doc comments. 2019-12-17 19:10:36 -05:00
Mark McCaskey
d165a85743 Improve some doc comments relating to type-safe indexing 2019-12-17 18:45:07 -05:00
losfair
1681af7e1d Merge remote-tracking branch 'origin/master' into fix/aarch64-cleanup 2019-12-17 23:27:53 +08:00
bors[bot]
c02846a147
Merge #1069
1069: Add fn for splitting borrow of memory & data in Ctx, use in WASI r=MarkMcCaskey a=MarkMcCaskey

Fixes a soundness issue / some undefined behavior

# Review

- [ ] 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>
2019-12-17 00:55:56 +00:00
Mark McCaskey
2819821ab7
Fix typo in doc comment
Co-Authored-By: nlewycky <nick@wasmer.io>
2019-12-16 16:37:34 -08:00
Mark McCaskey
9ccb59eae5 Add minor changes to runtime/vm doc comments + make fns const fns 2019-12-16 18:27:37 -05:00
Mark McCaskey
15c52fd743 Update doc comment on borrow splitting ctx fn 2019-12-16 18:16:20 -05:00
Mark McCaskey
bb344c1ab1 Add fn for splitting borrow of memory & data in Ctx, use in WASI 2019-12-16 16:48:52 -05:00
losfair
912c2f8996 Run cargo fmt. 2019-12-17 00:36:00 +08:00
losfair
4d7eec10e9 fault, state: Cleanup and keep consistent with backend. 2019-12-17 00:32:26 +08:00
losfair
57615e5673 runtime-core/backend: Add comments and cleanup. 2019-12-17 00:31:47 +08:00
Nick Lewycky
0a278c55ee For error handling and breakpoints, use Box<Any + Send> instead of Box<Any>. 2019-12-09 21:00:01 -08:00
bors[bot]
2139357021
Merge #709
709: new feature flag: `deterministic` r=MarkMcCaskey a=YaronWittenstein

The motivation for the PR is for introducing a new feature flag called `deterministic`.

When `deterministic` will be enabled (turned-off by default) it'll guarantee deterministic
execution of wasm programs across different hardware/circumstances.

This is critical for Blockchain projects that require execution to be deterministic
in order to reach a consensus of the state transition of each smart-contract transaction.

Co-authored-by: Yaron Wittenstein <yaron.wittenstein@gmail.com>
Co-authored-by: Yaron Wittenstein <yaronwittenstein@users.noreply.github.com>
Co-authored-by: Mark McCaskey <5770194+markmccaskey@users.noreply.github.com>
Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-12-06 21:24:40 +00:00
Nick Lewycky
8d3cf874cd Add the ability to pass backend specific options through CompilerConfig.
Use this to replace wasmer_llvm_backend::GLOBAL_OPTIONS.
2019-12-05 12:13:51 -08:00
Mark McCaskey
c7f3abd27e
Merge branch 'master' into deterministic 2019-12-05 11:50:16 -08:00
losfair
063fa211a7 Merge remote-tracking branch 'origin/master' into feature/singlepass-cache 2019-11-29 01:33:29 +08:00
losfair
cfa0635026 Add caching support for singlepass backend. 2019-11-28 02:49:52 +08:00
Asami Doi
fd0df9946b Add "auto" backend to change the backend depending on the wasm file size 2019-11-27 20:04:35 +09:00
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