Commit Graph

38 Commits

Author SHA1 Message Date
e062e87d8b Refactored Compilers 2020-06-17 19:17:06 -07:00
03494ac1a2 Unify trampolines in Compilation object 2020-06-16 20:11:47 -07:00
e2cafd07da Improved compilation with Dwarf 2020-06-10 21:37:36 -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
abbd39c50b Refactor trampoline compilation 2020-05-29 19:37:03 -07:00
45e80dec7b Add support for dynamic trampolines in compiler-llvm. 2020-05-29 16:56:41 -07:00
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
09e057338a Renamed Module to ModuleInfo 2020-05-19 18:47:50 -07:00
808cf9eb0d Remove obsolete comment and variables.
Expound upon comment. Fix typo.
2020-05-19 11:23:53 -07:00
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
f20d09fb2d Fixed LLVM compilation 2020-05-18 13:23:19 -07:00
9981a51f8f Merge pull request #23 from wasmerio/host-trampolines
Improved trampolines adding support for Dynamic functions
2020-05-18 13:12:37 -07:00
aa4aa65d0c Remove some calls to clone() by using into_iter(). 2020-05-18 09:08:33 -07:00
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
5dfa9faafb Improve compiler names for trampoline functions 2020-05-17 20:32:42 -07:00
5f8f7a5dc1 Merge branch 'master' into host-trampolines 2020-05-15 20:07:40 -07:00
9a0c2a76a3 Add a list of relocations to custom sections. 2020-05-14 12:22:32 -07:00
1c21e4f927 Make host trampolines work (PoC) 2020-05-13 20:53:54 -07:00
0bd6a0dd6b Renamed FuncIndex to FunctionIndex 2020-05-04 13:39:12 -07:00
2997be7d88 Renamed FuncType to FunctionType 2020-05-04 13:34:05 -07:00
3a004b3e82 Fix build of compiler-llvm by growing the interface to SectionBody. 2020-05-03 16:08:05 -07:00
fd96c4080e Merge branch 'master' into frame-info
# Conflicts:
#	lib/compiler-llvm/src/compiler.rs
#	lib/compiler-llvm/src/translator/code.rs
2020-05-01 22:09:26 -07:00
20ad3d608f Fixed LLVM with new compiler structure 2020-05-01 22:04:33 -07:00
4827434eef Build up list of per-function custom sections and build local relocations into them. 2020-05-01 16:31:26 -07:00
cf70a297d8 Fixed compilation 2020-05-01 15:57:18 -07:00
1227d50e9b Initial commit for support of custom sections. 2020-05-01 15:46:45 -07:00
c33a368ff8 Added custom sections
Based on this document:

https://www.notion.so/wasmer/Compiler-Refactor-Proposal-c678a73b0e2c4572834d2dba21263916
2020-05-01 11:23:22 -07:00
71eeb135bc Parse a relocation to a different user function out of the object file.
This updates to a newer inkwell to pick up a fix to Section::get_contents. Picking that up changed builder.build_struct_gep to return a Result, and there's many API updates scattered around to support that.

Compute the function names for all local and imported functions in the module in advance and pass that mapping to the function code generation.

debug_trap is added to Intrinsics, though all users are commented out.
2020-04-29 17:41:30 -07:00
1de21f0c33 Make translator::intrinsics accessible to trampoline.
Start filling in the code to generate trampolines. Move func_type_to_llvm and type_to_llvm from code.rs to intrinsics.rs so that trampoline code can reuse them.
2020-04-24 16:42:14 -07:00
a6bde15ce5 Connect trampoline code to trampoline module. Still unimplemented. 2020-04-24 16:31:31 -07:00
8b7da22a1a Make vmctx an i8* so that we can use byte addressing.
Implement dynamic_sigindex.
2020-04-24 15:37:45 -07:00
56fe08ad00 Assorted fixes:
Fix creation of the target machine. Fix CPU features, architecture and target name.

Function names are not mandatory. Support unnamed functions.

Include parameters and local variables in the list of local variables for LLVMFunctionCodeGenerator.

Run the tests single-threaded, using a Mutex in the rayon code. This means that only the first error is real, subsequent errors are just picking up the panic across threads.

Add TODOs about attributes on vmctx.
2020-04-23 23:32:17 -07:00
7f4fa66a23 Fix build of compiler-llvm. 2020-04-22 16:30:55 -07:00
4e6371c3ce Fix most compile issues in compiler-llvm.
Still to be fixed are MemoryPlan, MemoryStyle, TablePlan, and TableStyle.
2020-04-22 16:30:55 -07:00
f62f475309 Return Features & Target by reference in Compiler 2020-04-22 11:07:45 -07:00
feef35364b Renamed *Defined into *Local for better clarity 2020-04-21 23:19:33 -07:00
68b500ad84 Moved TrapInformation to the Compiler 2020-04-21 23:01:43 -07:00
a402691303 First iteration of wasmer-reborn 2020-04-21 21:37:33 -07:00