Commit Graph

214 Commits

Author SHA1 Message Date
8daeff8bc8 Fix section names for MachO. 2020-08-07 17:19:55 -07:00
b027949914 Pick section names that are valid in ELF and Macho. 2020-08-06 17:50:22 -07:00
2c2da8ec3c Wire up experimental_native_compile_module for LLVM.
Move Symbol and SymbolRegistry to wasmer_compiler crate.
2020-08-05 17:44:52 -07:00
0e6bc3191f Fix the build post-merge that picked up SymbolRegistry. 2020-08-05 17:26:00 -07:00
afe568c5d3 Merge branch 'master' into llvm-native 2020-08-05 17:17:52 -07:00
bf0df80551 Rename CompilationNamer to SymbolRegistry.
SymbolRegistry is invertible so we can remove the wrappers.
2020-08-05 15:07:56 -07:00
64448dda40 Create new InvertibleCompilationNamer and use it to name generated functions.
Fixes build of rustc_binary2.wasm with --llvm.
2020-08-05 10:31:00 -07:00
b92b3d7b04 Split function translation into produce-Module and produce-CompiledFunction. 2020-08-05 09:57:51 -07:00
b4270525f0 Create new InvertibleCompilationNamer and use it to name generated functions.
Fixes build of rustc_binary2.wasm with --llvm.
2020-08-04 16:50:55 -07:00
29cfeeb03a Implement the remaining integer SIMD arithmetic instructions. 2020-08-03 15:56:01 -07:00
efb26b8c8b Reimplement vector min and max. They now always pick one of the two inputs. 2020-08-03 14:18:46 -07:00
4259f51519 Add i64x2.mul.
Remove commented-out i8x16.mul. This no longer exists in the SIMD proposal.
2020-07-31 14:33:51 -07:00
b1e3468be6 Fix boundary conditions on SIMD trunc_sat instructions. 2020-07-31 14:26:59 -07:00
fe080432d9 Implement SIMD integer widening operators. 2020-07-31 13:57:14 -07:00
242e178ab1 Add implementation of SIMD narrow operators. 2020-07-31 13:35:19 -07:00
03faf2c7a6 Implement v128.andnot. 2020-07-30 15:53:25 -07:00
fb1bdc6f8f Fixed lint 2020-07-30 15:20:00 -07:00
3e9c9d4cca Implement SIMD load and extend instructions in compiler-llvm. 2020-07-30 14:49:46 -07:00
a732159514 Use better naming for module functions 2020-07-26 12:02:45 -07:00
c1e3b445a1 Canonicalize floats before branch, in Operator::Return too. 2020-07-10 16:55:22 -07:00
cc081ffff6 Canonicalize the floats first, then branch out of the block. 2020-07-10 16:18:33 -07:00
92f8651312 Renamed wasmer_runtime to wasmer_vm 2020-07-07 21:26:06 -07:00
b57a28edc7 Removed Memory plans in favor of direct styles 2020-07-07 16:50:08 -07:00
98f2e8fe26 Remove TablePlans 2020-07-07 15:10:03 -07:00
b527127d0f load_object_file is returning an increasingly complex object.
Group the data from compilation of a function into its own struct and return that.
2020-06-18 16:43:43 -07:00
54c7b6f876 In trampoline generation, ensure all custom sections are eh frames.
.eh_frames may refer to the trampoline, but it is impossible to encode such a relocation. The optional relocation "self-referential" target is replaced with a better named mandatory argument. The value will be discarded in trampoline generation with the rest of the .eh_frame.
2020-06-18 15:37:08 -07:00
52eae576fc Record the .eh_frame sections from each .o file. 2020-06-18 15:34:23 -07:00
422051ebe5 Simplified compiler config names 2020-06-18 01:36:25 -07:00
8649f2eb79 Remove target from CompilerConfig 2020-06-17 20:26:50 -07:00
69ce68c31a Merge remote-tracking branch 'origin/master' into middleware 2020-06-17 00:52:20 +08:00
b00f899913 Update to Cranelift 0.65, wasmparser 0.57 2020-06-15 18:00:48 -07:00
1bbaafb819 Middleware for LLVM. 2020-06-16 00:56:43 +08:00
af46df5e4c Merge remote-tracking branch 'origin/master' into middleware 2020-06-13 00:55:47 +08:00
dc5c6dd10a Always put allocas at the beginning of the entry block.
Fixes a bug where we allocated stck space for struct return in every call of a function in a loop.
2020-06-08 22:01:22 -07:00
5ec1addae1 Use middleware reader 2020-06-08 13:30:38 -07:00
ce543fd4ed NFC. Don't re-lookup frame. It can't have changed, simply reorder operations. 2020-06-06 21:02:10 -07:00
b2c0ef4f95 NFC. Use const_zero() method or free function instead of const_int(0) and const_float(0.0). 2020-06-06 21:02:10 -07:00
fcbffb0b3e cargo fmt 2020-06-02 17:15:57 -07:00
153a32a9cd Factor this complex iterator into its own variable. 2020-06-02 17:15:31 -07:00
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
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
870f241fb7 cargo clippy 2020-06-02 15:46:18 -07:00
a03a5e1775 Also make type_to_llvm_ptr return a CompileError instead of using unimplemented!. 2020-06-02 15:46:18 -07:00
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
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
fa3242ce11 Fix bug updating phi nodes when branching up. 2020-06-02 15:44:39 -07:00
c3d26ef639 Reset the value stack correctly when entering the 'else' side of an if-else. 2020-06-02 15:44:39 -07:00
46159ee2a6 Fix value stack after return instruction in multi-value function. 2020-06-02 15:44:39 -07:00
95c55ab40d NFC. Pull this mapping into two mappings, I think it's nicer. 2020-06-02 15:44:39 -07:00
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