Commit Graph

2542 Commits

Author SHA1 Message Date
Ivan Enderlin
04c9d25194
Merge branch 'master' into fix-runtime-c-api-warnings 2019-06-14 10:07:53 +02:00
bors[bot]
52c02de409 Merge #493
493: feat(runtime-c-api) Improve error message when instantiating a module r=Hywan a=Hywan

This patch improves the error message returned by `wasmer_module_instantiate`.

Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
2019-06-14 07:55:34 +00:00
Ivan Enderlin
3f975457c7 doc(changelog) Add #494. 2019-06-12 12:18:41 +02:00
Ivan Enderlin
63ec73aacc fix(runtime-c-api) Remove deprecated types from libc.
Since https://github.com/rust-lang/libc/pull/1379, fixed width integer
type aliases are deprecated. Thus, this patch uses Rust types instead
of libc aliases.
2019-06-12 12:10:49 +02:00
Ivan Enderlin
a6b5eee32f doc(changelog) Add #493. 2019-06-12 11:39:59 +02:00
Ivan Enderlin
81d8e4ee2e feat(runtime-c-api) Improve error message when compiling a module. 2019-06-12 11:35:29 +02:00
bors[bot]
8f3cc5f7c9 Merge #485
485: add wasmptr memory abstraction to emscripten; update wasi array access r=MarkMcCaskey a=MarkMcCaskey



Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
Co-authored-by: Mark McCaskey <markmccaskey@users.noreply.github.com>
2019-06-11 10:41:04 +00:00
Syrus Akbary
7f81f54e0e
Updated CHANGELOG with merged PRs 2019-06-11 12:31:13 +02:00
Mark McCaskey
b36783fc50 remove duplicated code, wrap WasmPtr on wasi side 2019-06-11 11:10:42 +02:00
Mark McCaskey
7965ed2746 fix newly introduced bug in wasmptr array access 2019-06-10 13:32:33 +02:00
Mark McCaskey
7a66a5285d
Merge branch 'master' into feature/better-memory-access-for-emscripten 2019-06-10 03:26:50 -07:00
bors[bot]
1948ad53a9 Merge #490
490: Add MiddlewareChain and StreamingCompiler to runtime r=syrusakbary a=bjfish

It would be nice to add `MiddlewareChain` and `StreamingCompiler` to runtime to be able to use these without having to include the `runtime-core` as a dependency. For example:
```rust
use wasmer_runtime::{MiddlewareChain, StreamingCompiler};
use wasmer_singlepass_backend::ModuleCodeGenerator as SinglePassMCG;
use wasmer_middleware_common::metering::Metering;
let limit = 1_000_000;
let c: StreamingCompiler<SinglePassMCG, _, _, _, _> = StreamingCompiler::new(move || {
    let mut chain = MiddlewareChain::new();
    chain.push(Metering::new(limit));
    chain
});            
wasmer_runtime::compile_with(&prepared_code, &c)
    .map_err(|e| Error::Wasmer(format!("{}", e)))
            chain
        });            
wasmer_runtime::compile_with(&prepared_code, &c)
    .map_err(|e| Error::Wasmer(format!("{}", e)))
```

Co-authored-by: Brandon Fish <brandon.j.fish@gmail.com>
2019-06-10 10:01:22 +00:00
Brandon Fish
c6786474a7 Add MiddlewareChain and StreamingCompiler to runtime 2019-06-09 23:24:10 -05:00
bors[bot]
bea3ebd2f3 Merge #488
488: Remove inst-limit option from wasmer binary r=losfair a=bjfish

Also, fixes compilation issue in CI.

Co-authored-by: Brandon Fish <brandon.j.fish@gmail.com>
2019-06-09 03:20:36 +00:00
Brandon Fish
733ffa8854 Remove inst-limit option from wasmer binary 2019-06-08 16:48:41 -05:00
bors[bot]
d5dbabf605 Merge #487
487: Fix stack offset check in singlepass backend. r=losfair a=losfair

#486 

Co-authored-by: laizy <aochyi@126.com>
Co-authored-by: losfair <zhy20000919@hotmail.com>
2019-06-08 15:03:02 +00:00
losfair
61786a370a Fix typo in machine. 2019-06-08 22:56:13 +08:00
losfair
1477062474 Add test case for PR 486 fix. 2019-06-08 22:55:24 +08:00
laizy
1780d57df1 add Mechine::release_locations_keep_state test 2019-06-08 22:25:20 +08:00
laizy
8105c0c16f fix stack offset check 2019-06-08 15:03:56 +08:00
bors[bot]
5db8c13465 Merge #450
450: Metering. r=bjfish a=losfair

TODO
- [x] Add test to verify points used after function call
- [x] Add test to verify function call will trap
- [x] Add documentation

Co-authored-by: losfair <zhy20000919@hotmail.com>
Co-authored-by: Brandon Fish <brandon.j.fish@gmail.com>
2019-06-07 20:44:41 +00:00
Brandon Fish
f6ecfa40cb
Merge branch 'master' into feature/metering 2019-06-06 23:33:31 -05:00
Brandon Fish
e87d507162 Add black_box to benchmarking 2019-06-06 23:30:31 -05:00
Brandon Fish
418764a15f Add get/set gas used for benchmark 2019-06-06 23:25:11 -05:00
Syrus Akbary
98e04193af
Merge branch 'master' into feature/better-memory-access-for-emscripten 2019-06-06 18:03:55 -07:00
Mark McCaskey
811acd7e68 probably actually fix the wasi ptr array bug now 2019-06-06 16:19:15 -07:00
bors[bot]
ade70c6e1a Merge #484
484: fix bugs in emscripten socket syscalls r=MarkMcCaskey a=MarkMcCaskey

resolves #482 
This PR fixes:
- incorrect argument order
  - which cascaded in to a casting issue 
  - which cascaded in to misaligning the arguments of a function
  - which cascaded in to attempting to access an OOB pointer
- sets fd limit to 1024, rather than emscripten's 64
- updates `prlimit64` to return the correct result for `RLIMIT_NOFILE`
- fixes bug in `prlimit64` due to a mistransaltion of the emscripten javascript

Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-06-06 22:50:06 +00:00
Mark McCaskey
d7ea46bab7 add wasmptr memory abstraction to emscripten; update wasi array access 2019-06-06 15:45:19 -07:00
Mark McCaskey
6f633cee6f fix pointer casting lint in emscripten syscall191 2019-06-06 12:07:19 -07:00
Mark McCaskey
8df63b1b6e fix bugs in emscripten socket syscalls 2019-06-06 11:55:05 -07:00
losfair
c6cd49a370 Support getting/setting metering points and internal fields with a Ctx. 2019-06-06 14:10:57 +08:00
Brandon Fish
27eacf0c4f Add metering benchmark 2019-06-06 00:37:04 -05:00
bors[bot]
4913cfaff4 Merge #481
481: Added context trampoline into runtime r=losfair a=syrusakbary

Based on #450 

Co-authored-by: losfair <zhy20000919@hotmail.com>
2019-06-05 11:36:54 +00:00
Brandon Fish
f832c8d315 Try to fix unused import error 2019-06-04 23:25:19 -05:00
losfair
f5243aff5e Cargo fmt 2019-06-05 11:52:25 +08:00
losfair
f2d8aad73a Support checking the execution limit exceeded error. 2019-06-05 11:51:33 +08:00
losfair
0867208e0c Implement {get,set}_points_used. 2019-06-05 02:28:19 +08:00
losfair
69944c1dc2 Fix ctx layout in LLVM. 2019-06-05 02:13:10 +08:00
losfair
66dcec91c4 Add comments for trampoline_x64. 2019-06-05 01:59:20 +08:00
losfair
f4df568e41 Naming fixes and documentation for trampoline API. 2019-06-05 01:38:35 +08:00
losfair
f1b27d5774 Cargo fmt 2019-06-05 01:26:35 +08:00
losfair
669f76025c Add callinfo trampoline into the C API. 2019-06-05 01:25:37 +08:00
losfair
b2869e181c Cargo fmt 2019-06-05 01:11:54 +08:00
losfair
8a74399c6e Add callinfo trampoline support. 2019-06-05 01:11:10 +08:00
losfair
06280e225e Fix unused_imports error on lazy_static. 2019-06-03 15:31:42 -07:00
losfair
0a44add31c Fix clippy errors. 2019-06-03 15:31:42 -07:00
losfair
d70cb9695e Add trampoline-related functions to C API. 2019-06-03 15:31:42 -07:00
losfair
7808c68cb2 Cargo fmt 2019-06-03 15:31:42 -07:00
losfair
ae19e7f71b Trampoline for calling with context. 2019-06-03 15:31:42 -07:00
Brandon Fish
66f9049a06 Reset LLVM related code to master 2019-06-02 19:36:26 -05:00