Commit Graph

68 Commits

Author SHA1 Message Date
Mark McCaskey
6e974b92cd Run cargo fmt 2020-08-13 18:12:43 -07:00
Mark McCaskey
5049c543dc Rename wasm-common crate to wasmer-types 2020-08-13 17:59:26 -07:00
Nick Lewycky
15b3a35e0c Don't clone function body data. 2020-08-07 14:31:36 -07:00
Nick Lewycky
037922bbf2 Change this API to return an Option that's None when it's unimplemented and Some(Result<...>) when it is. 2020-08-07 14:26:53 -07:00
Syrus
701973ffae Make Native Engine work with conditional native compilation 2020-08-07 11:35:42 -07:00
Nick Lewycky
c68e7da972 Emit dynamic trampoline for each function index, not just each signature.
Emit names for trampolines when building through that experimental native pipeline.
2020-08-06 13:39:41 -07:00
Nick Lewycky
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
Nick Lewycky
0e6bc3191f Fix the build post-merge that picked up SymbolRegistry. 2020-08-05 17:26:00 -07:00
Nick Lewycky
afe568c5d3 Merge branch 'master' into llvm-native 2020-08-05 17:17:52 -07:00
Nick Lewycky
02c62657f5 Add experimental_native_compile_module and initial implementation changing native engine to use it. 2020-08-05 17:12:17 -07:00
Nick Lewycky
bf0df80551 Rename CompilationNamer to SymbolRegistry.
SymbolRegistry is invertible so we can remove the wrappers.
2020-08-05 15:07:56 -07:00
Nick Lewycky
9ca46f4f2d Include trampolines in the generated object file. 2020-08-05 14:20:47 -07:00
Nick Lewycky
0b62c775de Verify the post-merge bitcode before codegen. 2020-08-05 12:12:47 -07:00
Nick Lewycky
8057083d1f Initial commit of LLVMCompiler::compile_native_object.
Entirely untested.

Works by doing function generation including optimization passes in parallel, then generating bitcode and passing that along to be reparsed into a new module and then module-linked into a single merged module to be emitted as an object file.
2020-08-05 11:25:56 -07:00
Nick Lewycky
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
Nick Lewycky
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
Syrus
a732159514 Use better naming for module functions 2020-07-26 12:02:45 -07:00
Syrus
b57a28edc7 Removed Memory plans in favor of direct styles 2020-07-07 16:50:08 -07:00
Syrus
98f2e8fe26 Remove TablePlans 2020-07-07 15:10:03 -07:00
Nick Lewycky
84b32ed2cd cargo fmt 2020-06-18 16:46:45 -07:00
Nick Lewycky
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
Nick Lewycky
30add15904 make lint cleanup 2020-06-18 15:50:35 -07:00
Nick Lewycky
27a0613e57 Remove unused use line. 2020-06-18 15:47:00 -07:00
Nick Lewycky
8edaf2d617 cargo fmt 2020-06-18 15:46:11 -07:00
Nick Lewycky
310ac6b44c Shrink the 0-length CIE. The previous one came from /bin/ls on my machine, the new one is based on the CIE description in the DWARF 3 spec (the LSB description leaves out too much detail, like the size of the version field).
Formatting cleanup.
2020-06-18 15:37:06 -07:00
Nick Lewycky
8d11d3fc52 Remove gimli leftovers. 2020-06-18 15:35:39 -07:00
Nick Lewycky
e9d5c7896c Merge .eh_frame without interpretation. Add a 0-CIE to the end.
Add unfinished attempt at using gimli, to be deleted but recorded in case we need it in the future.
2020-06-18 15:35:37 -07:00
Nick Lewycky
52eae576fc Record the .eh_frame sections from each .o file. 2020-06-18 15:34:23 -07:00
Syrus
422051ebe5 Simplified compiler config names 2020-06-18 01:36:25 -07:00
Syrus
8649f2eb79 Remove target from CompilerConfig 2020-06-17 20:26:50 -07:00
Syrus
e062e87d8b Refactored Compilers 2020-06-17 19:17:06 -07:00
Syrus
03494ac1a2 Unify trampolines in Compilation object 2020-06-16 20:11:47 -07:00
Syrus
e2cafd07da Improved compilation with Dwarf 2020-06-10 21:37:36 -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
Syrus
abbd39c50b Refactor trampoline compilation 2020-05-29 19:37:03 -07:00
Nick Lewycky
45e80dec7b Add support for dynamic trampolines in compiler-llvm. 2020-05-29 16:56:41 -07:00
Nick Lewycky
a47a3068f4 Remove #![allow(unused_imports, dead_code)] and fix resulting issues.
Fix nearly-all issues found by clippy too.
2020-05-20 17:18:23 -07:00
Syrus
09e057338a Renamed Module to ModuleInfo 2020-05-19 18:47:50 -07:00
Nick Lewycky
808cf9eb0d Remove obsolete comment and variables.
Expound upon comment. Fix typo.
2020-05-19 11:23:53 -07:00
Nick Lewycky
dff7cf28c9 Fix invalid LLVM IR for global.get/set of imported globals.
In passing, refactor global accesses and cache the address computations and values of const globals.

Also includes some cargo fmt fixes.
2020-05-18 14:35:23 -07:00
Syrus
f20d09fb2d Fixed LLVM compilation 2020-05-18 13:23:19 -07:00
Syrus Akbary
9981a51f8f Merge pull request #23 from wasmerio/host-trampolines
Improved trampolines adding support for Dynamic functions
2020-05-18 13:12:37 -07:00
Nick Lewycky
aa4aa65d0c Remove some calls to clone() by using into_iter(). 2020-05-18 09:08:33 -07:00
Nick Lewycky
ea05e16b6d Parse relocations that apply to custom relocations.
This rewrites the whole relocation parsing to work properly.
  * we no longer use LocalRelocation and simply assign a new SectionIndex as new sections are encountered.
  * we no longer use string matching to determine what function applies relocations to what, instead we use the field in the elf section header that tells us
  * we no longer merge sections, each section from every function is preserved as an independent custom section in the module.
  * we now discover any new sections that need to be pulled in recursively as we parse each section
  * many error cases are either handled, or report CompileErrors.
2020-05-18 09:08:33 -07:00
Syrus
5dfa9faafb Improve compiler names for trampoline functions 2020-05-17 20:32:42 -07:00
Syrus
5f8f7a5dc1 Merge branch 'master' into host-trampolines 2020-05-15 20:07:40 -07:00
Nick Lewycky
9a0c2a76a3 Add a list of relocations to custom sections. 2020-05-14 12:22:32 -07:00
Syrus
1c21e4f927 Make host trampolines work (PoC) 2020-05-13 20:53:54 -07:00
Syrus
0bd6a0dd6b Renamed FuncIndex to FunctionIndex 2020-05-04 13:39:12 -07:00
Syrus
2997be7d88 Renamed FuncType to FunctionType 2020-05-04 13:34:05 -07:00