Commit Graph

6495 Commits

Author SHA1 Message Date
Mark McCaskey
b46ea5b9cb Get NativeFunc passing basic tests 2020-06-08 12:53:00 -07:00
Mark McCaskey
2666a697ac Merge branch 'master' into trace-issue 2020-06-04 16:48:19 -07:00
Mark McCaskey
d1429fb18b Fix up macro issue 2020-06-04 16:41:57 -07:00
Syrus Akbary
3130faa909 Merge pull request #88 from wasmerio/feature/add-emscripten
Add Emscripten with no changes
2020-06-04 13:08:18 -07:00
Mark McCaskey
6ccdfeac8d Disable emscripten in workspace for now 2020-06-04 11:21:48 -07:00
Mark McCaskey
c5e8c407ef Add Emscripten with no changes 2020-06-04 11:18:40 -07:00
Mark McCaskey
ef8f7f450e Merge pull request #86 from wasmerio/fix-runtime-deprecated
fix(engine-jit,runtime) Fix deprecated items
2020-06-04 10:56:33 -07:00
Ivan Enderlin
4aec26b3ed fix(engine-jit,runtime) Fix deprecated items. 2020-06-04 13:23:04 +02:00
Syrus Akbary
179b90a34f Merge pull request #84 from wasmerio/table
Improved Table API to matching Memory API
2020-06-03 14:29:37 -07:00
Syrus
d0117b0509 Fixed lint issues 2020-06-03 14:11:34 -07:00
Syrus
f1b7e6539b Fixed issues 2020-06-03 14:06:50 -07:00
Mark McCaskey
fcbc21dfd1 Merge pull request #85 from wasmerio/fix/doc-improvements
Fix doc conflict between bin and lib `wasmer`
2020-06-03 14:06:13 -07:00
Mark McCaskey
00058b8008 Fix doc conflict between bin and lib wasmer 2020-06-03 13:55:10 -07:00
Syrus
f6fd628953 Improved Table API to matching Memory API 2020-06-03 13:51:26 -07:00
nlewycky
b3775ed97d Merge pull request #81 from wasmerio/llvm-multi-value
Implement multi-value in compiler-llvm.
2020-06-03 09:42:59 -07:00
Mark McCaskey
f800349a1b Merge pull request #83 from wasmerio/feature/reflection-in-wasm-c-api
Get `reflection` test in Wasm C API passing
2020-06-02 17:37:52 -07:00
Nick Lewycky
fcbffb0b3e cargo fmt 2020-06-02 17:15:57 -07:00
Nick Lewycky
153a32a9cd Factor this complex iterator into its own variable. 2020-06-02 17:15:31 -07:00
nlewycky
75b1f4c725 Call blocktype_params_results once to get params and results.
Co-authored-by: Syrus Akbary <me@syrusakbary.com>
2020-06-02 17:15:22 -07:00
Nick Lewycky
1990e83ca9 Add two new functions to abi.rs, is_sret and pack_values_for_register_return.
Pull the implementations out of wasm.rs and code.rs respectively, and simplify them.
2020-06-02 16:50:46 -07:00
Nick Lewycky
2e68b04e24 Make this match return a CompileError instead of use unimplemented!. 2020-06-02 15:54:22 -07:00
Nick Lewycky
870f241fb7 cargo clippy 2020-06-02 15:46:18 -07:00
Nick Lewycky
a03a5e1775 Also make type_to_llvm_ptr return a CompileError instead of using unimplemented!. 2020-06-02 15:46:18 -07:00
Nick Lewycky
7bdd387474 Use blocktype_params_results in lieu of blocktype_to_types.
Remove read_info.rs entirely.

Add `to_compile_error` that converts a WasmResult into a Result<_, CompileError>, use it with `wptype_to_type`. This is a candidate for being moved into shared code.

Many functions had to change to deal with propagating CompileError.
2020-06-02 15:46:16 -07:00
Nick Lewycky
04f2db1b82 Export wptype_to_type from wasmer_compiler.
Also fix up its error message when it fails.

Use it in compiler-llvm and remove one of compiler-llvm's copies of this function.
2020-06-02 15:45:31 -07:00
Nick Lewycky
fa3242ce11 Fix bug updating phi nodes when branching up. 2020-06-02 15:44:39 -07:00
Nick Lewycky
c3d26ef639 Reset the value stack correctly when entering the 'else' side of an if-else. 2020-06-02 15:44:39 -07:00
Nick Lewycky
46159ee2a6 Fix value stack after return instruction in multi-value function. 2020-06-02 15:44:39 -07:00
Nick Lewycky
95c55ab40d NFC. Pull this mapping into two mappings, I think it's nicer. 2020-06-02 15:44:39 -07:00
Nick Lewycky
f39a38779b Update function prologue, epilogue and CFG instructions.
The function prologue now skips the sret argument if there is one.

The function epilogue packs values before return.

Br/BrIf/BrTable/Block/Loop/If/Else/End are updated to support multiple values.
As part of this, `read_info::blocktype_to_type` is removed. `blocktype_to_types` and `blocktype_to_param_types` take its place.

CtxType::func is updated to cache and return attributes. The allows the caller to place 'sret' on the call site, even though it's present on the FunctionValue. This helps some utility functions that check the callsite for presence of sret.
2020-06-02 15:44:39 -07:00
Nick Lewycky
ba8a6d6db6 Update trampoline code and use get_vmctx_ptr_param. 2020-06-02 15:44:39 -07:00
Nick Lewycky
83195a1498 Use abi::func_type_to_llvm when producing an LLVM function type from wasm types.
This renames `func_sig_to_llvm` to `func_type_to_llvm` and deletes the old version in intrinsics::. The new version returns a list of attributes along with the type. Update callers to set these attributes on the function or call site.
2020-06-02 15:44:39 -07:00
Nick Lewycky
e5ea5789ea Use args_to_call and rets_from_call in both calls and indirect calls. 2020-06-02 15:44:39 -07:00
Nick Lewycky
2812a3330f Use abi::args_to_call in indirect calls too. 2020-06-02 15:44:39 -07:00
Nick Lewycky
f762690dfb Use abi::args_to_call when placing a direct call. 2020-06-02 15:44:39 -07:00
Nick Lewycky
4f9d8a5012 Initial commit of SysV ABI implementation. 2020-06-02 15:44:39 -07:00
Nick Lewycky
14188bed44 Revert "Ignore multi-value errors on LLVM too, for now."
This reverts commit 486dedc601.
2020-06-02 15:44:39 -07:00
Mark McCaskey
e9c7f3f759 Get reflection test in Wasm C API passing 2020-06-02 15:29:22 -07:00
Syrus
a5f40c2375 Small non-important change to trigger tests with cache 2020-06-02 14:42:48 -07:00
Syrus
6412d36d67 Added GH Actions cache 2020-06-02 14:05:51 -07:00
Mark McCaskey
b7ab3b7979 Merge pull request #80 from wasmerio/add-extern-type-to-wasm-c-api
Implement extern types in Wasm C API
2020-06-02 13:57:29 -07:00
Mark McCaskey
08a2810b4c Rename extrn -> extern_ in Wasm C API 2020-06-02 13:20:50 -07:00
Mark McCaskey
384806e90f Remove debug code 2020-06-02 13:12:55 -07:00
Syrus Akbary
06e646bc6b Merge pull request #82 from wasmerio/nlewycky-patch-1
Remove commented-out debugging cruft.
2020-06-02 13:12:51 -07:00
Mark McCaskey
79bc6b7f71 Fix UB bugs breaking Wasm C API callback example on Linux 2020-06-02 12:33:45 -07:00
nlewycky
6e98f39568 Remove commented-out debugging cruft.
This was made obsolete by PR #79.
2020-06-02 11:03:36 -07:00
Mark McCaskey
11c37c9ed1 Wasm C API: fill out some data transformation code 2020-06-02 10:44:33 -07:00
Heyang Zhou
c68fe8f4da Merge pull request #76 from wasmerio/allocate-alignment
Align allocations to 16-byte boundaries (for x86-64).
2020-06-03 01:42:26 +08:00
losfair
0878147733 Add comment on emit_nop_n. 2020-06-03 00:52:16 +08:00
losfair
5d94837f9b Merge remote-tracking branch 'origin/master' into allocate-alignment 2020-06-03 00:49:18 +08:00