Commit Graph

1200 Commits

Author SHA1 Message Date
Ivan Enderlin
2b250c30f3 chore(runtime-c-api) Regenerate C/C++ header files. 2019-05-14 11:50:10 +02:00
Ivan Enderlin
f68379a6df test(runtime-c-api) Use *_arity variables when calling wasmer_export_func_call. 2019-05-14 11:49:40 +02:00
Ivan Enderlin
d3c75a38fa fix(runtime-c-api) wasmer_instance_call types matches wasmer_export_func_*_arity.
The `wasmer_export_func_params_arity` and
`wasmer_export_func_returns_arity` functions store the arity in a
`uint32_t`. The `wasmer_instance_call` expects `c_int`. There is a
type mismatch here. It's not annoying in C or C++, but in some other
languages that have bindings to C/C++, it can imply useless casting.

This patch changes `wasmer_instance_call` to expect `uint32_t` for
`params_len` and `results_len` to match the
`wasmer_export_func_*_arity` functions.
2019-05-14 11:46:43 +02:00
losfair
d641909c63 Fix clippy error 2019-05-14 17:13:17 +08:00
losfair
ee09209bfb Fix clippy error. 2019-05-14 16:59:18 +08:00
losfair
d60e2377c1 Only compile kwasm-net for wasm32-wasi. 2019-05-14 16:45:26 +08:00
losfair
1e7a928d64 Add comments. 2019-05-14 16:13:42 +08:00
losfair
32f9aee6fe Cargo fmt 2019-05-14 16:04:08 +08:00
losfair
722ea39877 Cleanup loader code. 2019-05-14 16:02:27 +08:00
losfair
2a160c74ad Fix wasmer-runtime-core dependency version. 2019-05-14 15:47:19 +08:00
losfair
db9705f00c Merge remote-tracking branch 'origin/master' into feature/remote-code-load 2019-05-14 15:46:15 +08:00
Heyang Zhou
2963b0a2eb Make schedule() faster. 2019-05-14 00:04:32 -07:00
Syrus
19eba19603 Merge branch 'master' into doc-runtime-c-api
# Conflicts:
#	lib/runtime-c-api/src/lib.rs
2019-05-13 15:55:20 -07:00
Syrus
8218e550fc Improved docs and fixed few typos 2019-05-13 11:18:57 -07:00
Syrus
5a6cb96714 Merge branch 'master' into docs/better-runtime-docs
# Conflicts:
#	lib/runtime-core/src/vm.rs
2019-05-13 11:08:00 -07:00
Heyang Zhou
884a7e1713 kwasm-net fixes and optimizations. 2019-05-13 10:15:03 -07:00
Heyang Zhou
3bcdfb4263 Asynchronous networking extension. 2019-05-13 06:14:28 -07:00
Heyang Zhou
af1ac9af96 Improve performance of memory access. 2019-05-13 05:11:08 -07:00
Ivan Enderlin
b050144898 Merge branch 'master' into fix-runtime-c-api-error-length 2019-05-13 10:59:11 +02:00
Ivan Enderlin
8c8586faaa test(runtime-c-api) Assert returned value from wasmer_last_error_message. 2019-05-13 10:52:55 +02:00
Ivan Enderlin
bedd305b06 doc(runtime-c-api) Fix inline comment. 2019-05-13 10:52:43 +02:00
bors[bot]
b2227314a7 Merge #436
436: Add deny for unreachable patterns and unused unsafe r=syrusakbary a=bjfish



Co-authored-by: Brandon Fish <brandon.j.fish@gmail.com>
2019-05-12 22:16:44 +00:00
Brandon Fish
2aefa731a6 Add deny for unreachable patterns and unused unsafe 2019-05-12 00:33:02 -05:00
Brandon Fish
a96d5cb975 Fix f32/f64 conversion, add tests, and rename conversion method 2019-05-11 19:26:17 -05:00
Brandon Fish
85158ac22a Add some initial deny for unused_imports and unused_variables
Additional unused variable fix on unix

Remove unused import on unix

Remove unused windows import
2019-05-11 09:23:25 -05:00
Mark McCaskey
02f3349cb1 clean up, update changelog 2019-05-10 10:58:06 -07:00
Mark McCaskey
a527154c62 major improvements to wasi fs calls; include explanation in unimpl!s 2019-05-10 10:54:36 -07:00
Ivan Enderlin
7d2721ef7a fix(runtime-c-api) wasmer_last_error_message returns the length + 1.
Returning the error message's length + 1 mimics the
`wasmer_last_error_length` function that counts the trailing null
byte.
2019-05-10 16:00:13 +02:00
Ivan Enderlin
1d555301f7 feat(runtime-c-api) Check buffer size before creating the slice.
It's safer to check the buffer size is large enough to hold the error
message before creating the slice from raw parts.

Also, this patch remove the need for `last_error`, simplifying the
code a little bit. The `length` variable is casted to `usize` once.
2019-05-10 15:55:02 +02:00
Mark McCaskey
1f99ef8377 implement some FS operations for rsign2 2019-05-09 16:01:36 -07:00
Brandon Fish
080220c6a7
Merge branch 'master' into feature/llvm-cgapi 2019-05-08 17:33:06 -07:00
Heyang Zhou
620a6ddd85 Disable memory bound checking for kernel loader. 2019-05-08 10:25:29 -07:00
Johan Andersson
36a78a23b6 Fix Windows crash on caching compiled artifact.
Memory clone function wasn't able to write to new reserved memory object.

Changed so allocating Memory objects with protection flag allocates commited memory.
2019-05-08 15:59:00 +02:00
Brandon Fish
54095fcd67 Clean up commented out code in LLVM codegen 2019-05-07 22:53:48 -05:00
Heyang Zhou
0bbd6e6970 Fix function offset. 2019-05-07 08:25:46 -07:00
losfair
e53d5a91ca Remove transmutes. 2019-05-07 19:20:18 +08:00
Brandon Fish
9c0cbc9775 Remove previous LLVM parser code 2019-05-06 23:41:31 -05:00
Brandon Fish
87a94657d0
Merge branch 'master' into feature/llvm-cgapi 2019-05-06 22:39:20 -05:00
Mark McCaskey
e5dc94c7d6 update version number to 0.4.1 2019-05-06 18:02:39 -07:00
Mark McCaskey
e40b4a2c39 fix debug code 2019-05-06 14:58:44 -07:00
bors[bot]
94e6c7318f Merge #424
424: Update emscripten to run JSC r=syrusakbary a=MarkMcCaskey



Co-authored-by: Mark McCaskey <mark@wasmer.io>
2019-05-06 21:19:27 +00:00
Mark McCaskey
91d01d1c05 clean up warnings 2019-05-06 14:17:23 -07:00
Mark McCaskey
ab184aceea Update emscripten to run JSC 2019-05-06 14:05:04 -07:00
bors[bot]
704c783b54 Merge #414
414: Exception logging (win32): Handle error codes correctly, add some more strings r=syrusakbary a=hrydgard

Ran into a situation with an unknown exception from Cranelift (will probably report that one separately). Turns out the signum was "1" though which does not seem to correspond to any of the Windows error codes, except possibly STATUS_GUARD_PAGE which is 0x80000001, but only if we lost the top bit somewhere.

On Windows, exceptions seemed to be trapped by callProtected, which is implemented here: cade9a666f/lib/win-exception-handler/exception_handling/exception_handling.c . It did not seem to correctly store and retrieve the exception code, instead always returning 1: ```longjmp(jmpBuf, 1);```

So I fixed it. And now the log output looks like this:

```
unhandled trap at 1560d5e7bab - code #c0000005: segmentation violation
```


Co-authored-by: Henrik Rydgård <henrik.rydgard@embark-studios.com>
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
Co-authored-by: Mackenzie Clark <mackenzie.a.z.c@gmail.com>
2019-05-06 19:54:21 +00:00
Pekka Enberg
089aab296d codegen: Remove unused LoadError import
Rustc complains that:

  warning: unused import: `parse::LoadError`
   --> lib/runtime-core/src/codegen.rs:7:5
    |
  7 |     parse::LoadError,
    |     ^^^^^^^^^^^^^^^^
    |
2019-05-06 20:42:35 +03:00
Heyang Zhou
0895dc60c2 Check param count. 2019-05-06 09:19:56 -07:00
Heyang Zhou
b343fd40bc Pass in param count for import functions in kernel loader. 2019-05-06 08:28:12 -07:00
Mackenzie Clark
10b4a08ca6
Merge branch 'master' into improve-exception-logging 2019-05-06 08:09:24 -07:00
Heyang Zhou
61510f8116 Enforce runtime memory and stack bound check when using kernel loader. 2019-05-06 07:15:30 -07:00
Brandon Fish
0926a5020e Implement caching for parser refactor 2019-05-05 20:11:47 -05:00
Syrus
8f345e9e8c Fixed ioctl in Unix. Fixed provied main arguments 2019-05-05 13:55:40 -07:00
Syrus
789af39f9e Improved ioctl calls 2019-05-05 12:31:31 -07:00
Brandon Fish
4770277b15 Remove parser refactor commented out code, unused imports and fields 2019-05-05 14:28:40 -05:00
Syrus
f076c04b76 Moved from println to debug the emscripten entrypoint statement 2019-05-05 12:14:25 -07:00
Syrus
341766dee5 Fixed format 2019-05-05 12:09:55 -07:00
Syrus
2ba680ad2f Improved rename function 2019-05-05 12:09:27 -07:00
Brandon Fish
e1138a553b Fix LLVM refactor unreachable depth 2019-05-05 13:56:02 -05:00
Brandon Fish
31acf81762 cargo fmt 2019-05-05 13:37:36 -05:00
Brandon Fish
1864733ab8 Merge branch 'master' into feature/llvm-cgapi 2019-05-05 13:25:51 -05:00
Syrus
10a965cc1e Added few syscalls to run optipng 2019-05-05 11:24:57 -07:00
Syrus
90dd4bc458 Fix emtests 2019-05-05 11:21:28 -07:00
Heyang Zhou
7bc09ee220 kwasmd. 2019-05-05 09:32:35 -07:00
Heyang Zhou
cc01e40dc5 Split load/run 2019-05-05 05:03:07 -07:00
Heyang Zhou
46e4cb05bc Get memory intrinsics at runtime. 2019-05-04 10:33:12 -07:00
Brandon Fish
60c0504bdf Implement llvm returns in function code generator finalize 2019-05-04 12:07:21 -05:00
Heyang Zhou
a590d7cd07 Tables 2019-05-04 09:56:52 -07:00
Heyang Zhou
c4e4efc694 kwasm imports 2019-05-04 08:28:13 -07:00
Heyang Zhou
af0b1476f3 Add emit_u64 to Emitter API 2019-05-04 07:25:29 -07:00
Heyang Zhou
7a4b2172a5 Remove runtime dependence for BrTable 2019-05-04 07:25:11 -07:00
Heyang Zhou
af58ea5642 Kernel mode code loading. 2019-05-03 23:07:07 -07:00
Mark McCaskey
353ff60c0f add misc changes while debugging 2019-05-03 17:34:57 -07:00
Brandon Fish
c5caf9b6db Update LLVM FCG begin_body 2019-05-03 00:14:25 -05:00
losfair
14bfd75ac9 Code loader framework. 2019-05-03 00:23:41 +08:00
Henrik Rydgård
5e37368ec9 Exception logging (win32): Handle error codes correctly, add some more strings. 2019-05-02 12:45:52 +02:00
Syrus Akbary
c0a5f74d0c
Update lib/middleware-common/Cargo.toml 2019-05-01 11:32:57 -07:00
Syrus Akbary
67c4d74eb4
Update middleware version to 0.4.0 2019-05-01 11:28:14 -07:00
Brandon Fish
8d86844c5f
Merge branch 'master' into parser-middleware 2019-05-01 13:10:44 -05:00
losfair
99c101f312 Merge remote-tracking branch 'origin/master' into parser-middleware 2019-05-02 00:30:58 +08:00
Mark McCaskey
2646765671
Merge branch 'master' into update-version-numbers-to-4 2019-05-01 09:27:38 -07:00
Brandon Fish
b016ec6b34 Add start_of_code_block to function 2019-04-30 23:44:34 -05:00
Brandon Fish
0ee2ba0ee6 Implement more of next_function and finalize 2019-04-30 23:22:41 -05:00
Brandon Fish
ec253c73ab Implement feed_local 2019-04-30 20:11:44 -05:00
Brandon Fish
39b6b05f71
Merge branch 'master' into atomic-transparent-repr 2019-04-30 17:09:18 -07:00
Syrus
747e5321a2 Fixed issues. Updated CHANGELOG 2019-04-30 12:05:13 -07:00
Syrus
ce140463d6 Merge branch 'master' into feature/jsc-emscripten 2019-04-30 11:47:28 -07:00
Syrus
e68f5e10e4 Improved emscripten functions to be able to run jsc 2019-04-30 11:47:03 -07:00
bors[bot]
82cf572245 Merge #404 #406
404: Update to newer common wasmparser version r=xmclark a=bjfish

- versions should match to have matching types in a common parser
- the `0.29.2` version matches the current parser version of cranelift-wasm

406: Cleanup some clippy warnings r=xmclark a=bjfish

Cleaned up some
- long literal lacking separators
- unneeded return

Co-authored-by: Brandon Fish <brandon.j.fish@gmail.com>
2019-04-30 15:37:12 +00:00
losfair
21dd01c3aa Fix LLVM backend compilation and segfaults. 2019-04-30 15:52:43 +08:00
Brandon Fish
01ba789eed Cleanup some long literal lacking separators 2019-04-29 23:49:00 -05:00
Brandon Fish
8acf9edf67 Remove unneeded returns 2019-04-29 23:45:38 -05:00
Brandon Fish
da807ed2a1 Remove unused imports 2019-04-29 23:40:16 -05:00
Brandon Fish
a127b770b3 Update to newer common wasmparser version 2019-04-29 23:34:48 -05:00
Mark McCaskey
d020ffd759 update version to 0.4.0 2019-04-29 13:26:51 -07:00
Brandon Fish
53bebf9c73 Add initial progress to add LLVM to module refactor 2019-04-29 00:13:34 -05:00
losfair
305e1801ff Fix incomplete data section 2019-04-28 15:38:18 +08:00
losfair
46fb72af9d Add missing .rev() on parameter list and simulate "red zone". 2019-04-28 13:31:22 +08:00
losfair
e63d7fd531 Merge 2019-04-28 12:58:27 +08:00
losfair
480308c62c Cargo fmt 2019-04-28 12:54:45 +08:00
losfair
cf83a9785f Print call trace to stderr. 2019-04-28 12:51:51 +08:00
losfair
6beb76c3ae Various cleanups. 2019-04-28 12:48:01 +08:00