Commit Graph

1624 Commits

Author SHA1 Message Date
Syrus Akbary
6a4091e78e
Merge branch 'master' into feature/no-mem-uninit 2019-07-30 22:28:56 -07:00
Mark McCaskey
0ab8a0de09 Remove all uses of mem::uninitialized for Rust 1.38 2019-07-31 13:21:20 +09:00
Mark McCaskey
b407633366 add logging to plugin example, improve swap, and add some consts 2019-07-31 12:51:55 +09:00
Mark McCaskey
c099ed54e9
Merge branch 'master' into feature/public-api-wasi-fs 2019-07-30 19:26:19 -07:00
Mark McCaskey
620a521690 clean up wasi fs public api changes 2019-07-31 09:58:39 +09:00
Syrus Akbary
0256a6eb88
Merge branch 'master' into features/llvm-windows 2019-07-30 17:38:36 -07:00
bors[bot]
7106a4f3cc Merge #599
599: Fix llvm backend failures in fat spec tests and simd_binaryen spec test. r=syrusakbary a=nlewycky



Co-authored-by: Nick Lewycky <nick@wasmer.io>
Co-authored-by: nlewycky <nick@wasmer.io>
2019-07-31 00:13:23 +00:00
Syrus
97c6956d98 Added llvm in windows support to Changelog 2019-07-30 15:56:25 -07:00
nlewycky
9b815cb518
Merge branch 'master' into features/llvm 2019-07-30 15:50:55 -07:00
Nick Lewycky
c42f47da34 Adjust simd_binaryen.wast until it works with LLVM except for known issues.
This doesn't yet work as of this commit, we'll need to pick up a new version of wasmparser.rs too.
2019-07-30 15:47:00 -07:00
Syrus
22f8b3f3dc Improved LLVM compilation for Unix 2019-07-30 15:32:21 -07:00
Syrus
89178732cc Fixed unix errors 2019-07-30 15:23:03 -07:00
Syrus
180e4766fe Merge branch 'master' into features/llvm-windows 2019-07-30 15:09:21 -07:00
Nick Lewycky
bdb1c4c44e Fix inkwell assertion due to treating vector as float. Fix llvm backend fatal error due to missing support for fminimum/fmaximum. 2019-07-30 14:59:04 -07:00
Syrus Akbary
12f8f3d085 First working version of LLVM in Windows 2019-07-30 14:47:53 -07:00
Nick Lewycky
3e7545a278 Fix the Trunc[SU] operations, makes conversions.wast pass. 2019-07-30 12:42:25 -07:00
Mark McCaskey
741fffedb0 fix metering benchmark 2019-07-30 15:59:21 +09:00
Mark McCaskey
fba09bef1a Add useful functions for external use of WASI filesystem 2019-07-30 14:53:42 +09:00
bors[bot]
e0e92dbb79 Merge #594
594: Improvement cache in Windows r=syrusakbary a=syrusakbary

Caching was disabled on Windows, but can be re-enabled easily by improving the folder cache naming.

Reason why caching was disabled on Windows: We use a very long string (64 chars) for the wasmer version (hash). But we can use the version directly (no need to hashing)

Co-authored-by: Syrus Akbary <me@syrusakbary.com>
2019-07-30 01:36:44 +00:00
Syrus Akbary
98b20d9240 Fixed Caching in Windows lint and improved code 2019-07-29 18:29:20 -07:00
Syrus Akbary
13901cc665 Improvement cache in Windows 2019-07-29 17:33:50 -07:00
Nick Lewycky
5f0ce6ef2f Enable SIMD when parsing the spec tests. 2019-07-29 15:47:38 -07:00
Nick Lewycky
7a1ddc0b5a Rename validate to validate_with_features. 2019-07-29 12:11:23 -07:00
Nick Lewycky
86316c474a Use --enable-simd to control whether SIMD is enabled in the wasmparser.
Before this change, 'wasmer run --backend=llvm some-simd.wasm' would run without complaint.

Also, note that the flag is not part of the cache key, so after any successful run, we can run it again without passing the flag.
2019-07-29 12:11:23 -07:00
Yaron Wittenstein
784e65d587 making wasmer_byte_array fields public 2019-07-29 17:24:43 +03:00
Yaron Wittenstein
8408260edd wasmer-c-api: adding #[derive(Debug)] for wasmer_result_t (so that we can do assert_eq!) 2019-07-29 17:10:17 +03:00
Yaron Wittenstein
a8d2469689 wasmer-c-api: returning back pub(crate) fn inner for export.rs 2019-07-29 13:44:56 +03:00
Yaron Wittenstein
10fc660aad wasmer_byte_array visibility revert (see PR: "wasmer-c-api-changes: making wasmer_byte_array fields public #589") 2019-07-29 13:41:28 +03:00
Nick Lewycky
11f66d287b Improve NaN handling by canonicalizing NaNs before most operations.
Not handled here is @llvm.minnum and @llvm.maxnum which should be replaced with
@llvm.minimum and @llvm.maximum, but using those currently leads to LLVM backend
fatal errors.
2019-07-28 22:53:48 -07:00
Nick Lewycky
2f021f0e2a LLVM srem is undefined in cases where i32.rem_s and i64.rem_s are defined. 2019-07-28 22:53:48 -07:00
Brandon Fish
d7c11bcf5f Fixes case with empty module, handle case with no signatures 2019-07-26 17:58:57 -05:00
bors[bot]
53c343bc6f Merge #579
579: fix caching for other backends, improve default compiler code r=MarkMcCaskey a=MarkMcCaskey



Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
2019-07-26 22:21:00 +00:00
Nick Lewycky
6cddc25ddd Derive Debug on these small structs. 2019-07-26 11:12:13 -07:00
Nick Lewycky
8f417f3d59 Add --enable-simd flag to wasmer run and wasmer validate. 2019-07-26 00:34:02 -07:00
Syrus Akbary
ab5f28851a
Merge pull request #578 from vavrusa/master
llvm-backend: export FunctionCodeGenerator and ModuleCodeGenerator
2019-07-25 17:08:50 -07:00
Mark McCaskey
d1a5cc9139 fix semver issue with clif 0.31 + new version of wasmparser 2019-07-25 10:38:20 -07:00
Yaron Wittenstein
f04d552361 wasmer-c-api:
* error.rs - changing `update_last_error` visibility to `pub`.
* error.rs - changing `CApiError` `msg` field visibility to `pub`.
2019-07-25 15:46:57 +03:00
Yaron Wittenstein
015616b541 export.rs - changing FuncPointer inner visibility to pub 2019-07-25 14:59:59 +03:00
Yaron Wittenstein
6cc31d3b49 lib.rs - making wasmer_byte_array fields public 2019-07-25 11:42:47 +03:00
Syrus Akbary
4ada51957d
Merge branch 'master' into feature/caching-fix-and-better-default-compiler 2019-07-24 18:58:45 -07:00
Marek Vavruša
659f088c4f llvm-backend: export FunctionCodeGenerator and ModuleCodeGenerator
This is in line with the singlepass-backend to be able to use LLVM MCG with
a StreamingCompiler.
2019-07-24 18:46:35 -07:00
Syrus
76daa7b3fd Improved Wasmer Backends documentation 2019-07-24 18:06:59 -07:00
Mark McCaskey
a3089a4501 fix caching for other backends, improve default compiler code 2019-07-24 17:31:59 -07:00
nlewycky
624f3459ab
Merge branch 'master' into simd 2019-07-24 14:44:52 -07:00
nlewycky
f6240721ea
Merge branch 'master' into simd 2019-07-24 14:08:24 -07:00
Nick Lewycky
4b1bc24a2b Update cranelift to the version crates.io.
This is needed in order for the resulting wasmer to be releasable.
2019-07-24 14:06:19 -07:00
Mark McCaskey
610c5bfe1f
Merge branch 'master' into ctx-drop-finalizer 2019-07-24 13:52:57 -07:00
Nick Lewycky
5c1b7d2e5b Adds the SIMD tests from binaryren, updated to work with wasmer.
This test is too large and therefore does not run by default, see
`fn is_fat_test` in spectests.rs.
2019-07-24 13:48:38 -07:00
Mark McCaskey
ce9bea402c
Merge branch 'master' into fix/dropping-bad-data 2019-07-24 13:32:42 -07:00
Mark McCaskey
3c952f307e fix Drop of uninit Ctx; use MaybeUninit 2019-07-24 11:29:16 -07:00
Nick Lewycky
f763de94ab Update to wabt 0.9.0. 2019-07-24 10:03:08 -07:00
Nick Lewycky
0ed104b543 Remove incorrect comment -- wasmer does support mutable globals.
The reason this test needed to be disabled is correctly documented in the comment above.
2019-07-23 17:13:02 -07:00
Nick Lewycky
16fe3ce0af Merge branch 'master' into simd 2019-07-23 13:51:15 -07:00
Nick Lewycky
fe2bd6ad6c Add missing names to LLVM instructions. 2019-07-23 13:19:27 -07:00
Mark McCaskey
ad7e3b52d3 Prepare for release of 0.5.7 2019-07-23 11:20:59 -07:00
Nick Lewycky
18307bb79c Improve panic/unreachable/unimplemented usage. Refactor a little. 2019-07-22 12:15:56 -07:00
Nick Lewycky
4535274cf3 Update the loader interface for 128 bit types. 2019-07-22 11:23:41 -07:00
Nick Lewycky
f8e8b1cdea Update to latest wasmer clif branch. 2019-07-22 10:59:27 -07:00
Yaron Wittenstein
c3ced14e46 Merge branch 'master' into ctx-drop-finalizer 2019-07-22 14:13:11 +03:00
Nick Lewycky
775c120b38 Update to newer wasmerio/wabt-rs. 2019-07-19 15:48:50 -07:00
Nick Lewycky
fc935710c7 Merge branch 'master' of github.com:wasmerio/wasmer into simd 2019-07-19 15:37:36 -07:00
Nick Lewycky
cd25356858 Fix shuffle and enable tests. Add support for new load_splat instructions.
Updates to wasmparser 0.34.0 and picks up a newer wasmerio/wabt.
2019-07-19 15:19:58 -07:00
Mark McCaskey
f15e90f8f3
Merge branch 'master' into feature/wasi-readlink 2019-07-19 13:36:27 -07:00
Mark McCaskey
a0672b3fa2 updates from code review 2019-07-19 13:36:05 -07:00
Mark McCaskey
328ef4e66e use correct debug macro on Windows 2019-07-19 12:55:58 -07:00
Mark McCaskey
d74560e1d4 impl fd_close 2019-07-19 12:10:45 -07:00
Mark McCaskey
a8a0dbed91 improve abstraction impl rm syscalls, properly finish create_dir 2019-07-19 11:47:31 -07:00
Mark McCaskey
9910527b30 further improve sandbox, rework syscalls, add tests 2019-07-18 17:14:01 -07:00
Nick Lewycky
3e009c5971 Reformat. 2019-07-18 13:40:24 -07:00
Nick Lewycky
ea93b68165 Bump size of global up to 128 bits.
Fixes last spec test failure from the WAVM SIMD spec test.
2019-07-18 13:39:41 -07:00
Nick Lewycky
3be6a024aa Fix bugs in V128 support based on results from testing against simd spec test.
These is one test failure remaining with V128 global variables.

* Fix trunc_sat. We need both the largest float that can be converted to an int
  and the largest int, they are not the same number.
* Implement calling of functions that take V128 by passing in two i64's.
* Improve support for V128 in spectests. Parse binary modules with the same
  features as the outer spectest. Fix compilation error involving Result in
  emitted .rs file. Handle V128 in more cases when producing .rs file. Parse
  the wast script with SIMD enabled.
* Adjust the WAVM spectest so that it parses with WABT and mostly passes with
  wasmer. Wabt is particular about ints not having decimal places and floats
  having decimal places. Wasmer does not support mutable globals or shared
  memory. Tests of shuffles are disabled. Some assert_invalid tests that wabt
  won't even parse are disabled.
2019-07-18 12:52:59 -07:00
nlewycky
3f3bf38d94
Fix typo in comment.
"Then thou must count to three. Three shall be the number of the counting and the number of the counting shall be three. Four shalt thou not count, neither shalt thou count two, excepting that thou then proceedeth to three."
2019-07-18 11:24:25 -07:00
Mark McCaskey
dc19bf32b9 fmt 2019-07-17 15:47:59 -07:00
Mark McCaskey
e7e1b8c7d3 get tests passing! (more tests and clean up required) 2019-07-17 15:32:47 -07:00
Mark McCaskey
65bc9a5203 massive fs rewrite; add virtual root, tests 2019-07-17 14:00:51 -07:00
Nick Lewycky
eeac6d5d2d Merge branch 'master' of github.com:wasmerio/wasmer into simd 2019-07-16 19:16:45 -07:00
Mark McCaskey
78702fc1a0 Merge remote-tracking branch 'origin/master' into feature/wasi-readlink 2019-07-16 13:50:56 -07:00
Mark McCaskey
cea7d5da7d add readlink test 2019-07-16 13:49:45 -07:00
Mark McCaskey
19f544e489 update to 0.5.6 2019-07-16 13:12:21 -07:00
Mark McCaskey
dd1ddea37b wip fs improvements 2019-07-15 17:37:11 -07:00
Syrus Akbary
193665461b
Merge branch 'master' into improve-wasi-tests 2019-07-15 12:43:21 -07:00
nlewycky
42780042ef
Fix typo in comment. 2019-07-15 10:55:26 -07:00
Mark McCaskey
affb9465d5 update rustfmt.toml to ignore and fmt 2019-07-15 10:43:30 -07:00
Mark McCaskey
53d7ecba2c improve wasitest infra and fix fseek test 2019-07-15 10:36:12 -07:00
Mark McCaskey
122963909f symlink code from last week 2019-07-15 09:59:07 -07:00
Yaron Wittenstein
ad10152982 * vm.rs - calling Ctx data_finalizer upon destruction 2019-07-15 15:14:09 +03:00
Syrus
24f1e99ead Fixed WASI tests 2019-07-13 16:00:18 -07:00
Syrus
b0ead8fc04 Merge branch 'master' into feature/complete-fd-seek 2019-07-13 15:40:51 -07:00
Brandon Fish
ed19fd2913 Update loader-kernel feature name, fix compilation track state, cargo fmt 2019-07-12 23:02:57 -05:00
Mark McCaskey
5119f07ea3 implement wasi::readlink 2019-07-12 15:58:28 -07:00
Mark McCaskey
a608f3aad0 fix wasi test template code 2019-07-12 15:17:10 -07:00
Mark McCaskey
cbac3ed92d finish implementation of wasi::fd_seek, fix bug in filestat 2019-07-12 15:10:16 -07:00
losfair
977fd1e25e Fix trap offset lookup. 2019-07-13 00:17:33 +08:00
losfair
450109e2bb Fix singlepass compilation error. 2019-07-13 00:17:21 +08:00
losfair
08cdc9a42f Allow disabling state tracking for faster startup. 2019-07-12 23:37:40 +08:00
losfair
f327feccef Merge remote-tracking branch 'origin/master' into fix/imul-relax 2019-07-12 23:37:01 +08:00
nlewycky
278adf678a
Merge branch 'master' into nlewycky/llvm 2019-07-11 16:48:46 -07:00
Nick Lewycky
7fb88251d4 Simplify trap_if_not_representable_as_int.
Fix typo in function name. Use two fcmp instructions instead of unpacking the bits of the IEEE float and using integer arithmetic to determine details about its value.
2019-07-11 16:46:37 -07:00
Nick Lewycky
7045030532 Try a new list of optimization passes.
A few notes:
a) the inliner doesn't help because all the calls are indirect and not even opt -O2 can figure out which functions they're actually calling.
b) aggressive instruction combining is not a super-set of the instruction combiner. Instcombine is made up of a large number (probably 10,000s) of patterns, and some particularly slow ones were taken out and moved to the aggressive instruction combiner. Aggressive instcombine *only* runs that handful of optimizations, which fired zero times on our example wasm files.
c) NewGVN is not ready for production, it has asserts that fire when building sqlite or cowsay. This is why sqlite didn't build with the llvm backend.
d) Scalar-replacement-of-aggregates (sroa) is a strict superset of promote-memory-to-registers (mem2reg), and you probably want sroa because it's usually faster. It also fires 10,000s more times than mem2reg on lua.wasm.
e) Aggressive-dead-code-elimination was only deleting as much regular dead-code-elimination, but is slower because it depends on a postdominator tree (PDT) analysis that. Other passes don't need PDT so we'll have to build it for just this one pass (as opposed to regular dominator-tree which is reused by many passes). I've replaced this with bit-tracking dead-code-elimination which deletes more code than dce/adce.
2019-07-11 14:48:07 -07:00
losfair
c186e0244e Fix compile error on imul. 2019-07-11 20:26:20 +08:00