Commit Graph

520 Commits

Author SHA1 Message Date
Nick Lewycky
6ed52be637 Add an explicit error when there's a relocation against .rodata. 2020-05-13 15:57:41 -07:00
Nick Lewycky
486dedc601 Ignore multi-value errors on LLVM too, for now. 2020-05-13 15:57:41 -07:00
Mark McCaskey
2f1de920f0 Fix up master
This happened because we didn't use something like bors to ensure we
were merging into the latest master
2020-05-13 15:42:10 -07:00
nlewycky
ea90cadaf1 cargo fmt
https://github.com/wasmerio/wasmer-reborn/runs/672125543?check_suite_focus=true
2020-05-13 13:18:27 -07:00
Nick Lewycky
30a86db05b Fix type of OOB reported on call indirect index outside table. 2020-05-13 13:02:24 -07:00
Nick Lewycky
fe42749002 Implement support for imported function calls. They need to be looked up from the vmctx at runtime.
In order to work with spectests, we need to change our function types to include a second fixed parameter, there are now two vmctx's (callee and caller) before any other arguments. Because we have a uniform call sequence for imported and local function calls (which we must have because we store both in the table and don't store what kind it is), we need to change the llvm function types for all our own functions and update how we call them and how we find our own arguments.
2020-05-13 12:49:26 -07:00
Nick Lewycky
119320603c Sometimes we generate our own function names. Look up names in our name map, not the wasm module. 2020-05-13 11:50:23 -07:00
Nick Lewycky
26cea55e84 Use &x[y] instead of x.get(y).unwrap() on PrimaryMap and SecondaryMap. 2020-05-13 11:29:42 -07:00
Nick Lewycky
4e9bb35e41 We depend on llvm 10, fix build.rs. While at it, bump to latest inkwell. 2020-05-13 11:05:58 -07:00
Nick Lewycky
6871d327b1 Bounds check pointer accesses to dynamic memory plan memory. 2020-05-12 21:11:42 -07:00
Nick Lewycky
613e40ed79 The llvm compiler uses ELF under the hood, attempt to convert any Target to the same thing, but with ELF. 2020-05-12 21:11:42 -07:00
Syrus
3a991a7f59 Upgrade libc to 0.2.70. Removedd unnecessary trap shims 2020-05-12 17:43:43 -07:00
Nick Lewycky
af6a26381a Disable local debugging code. 2020-05-12 15:03:54 -07:00
Nick Lewycky
3b23ab2146 Fix call_indirect. 2020-05-11 17:12:47 -07:00
Nick Lewycky
fce8dacc10 Reimplement table_prepare for new vmctx. 2020-05-11 16:06:02 -07:00
Mark McCaskey
d9ca668607 Merge pull request #6 from wasmerio/add-c-api
Add C API
2020-05-08 16:10:09 -07:00
Nick Lewycky
63d7df78fa Implement load and store. 2020-05-07 18:30:30 -07:00
Mark McCaskey
480ecd2cda Apply various fixes to get the C API working
24% of tests are passing now!
2020-05-07 14:02:13 -07:00
Nick Lewycky
91411aefe8 Implement support for memory.grow and memory.size. 2020-05-06 19:11:11 -07:00
Nick Lewycky
9e4550d4bc Add missing TODO. 2020-05-06 15:25:44 -07:00
Nick Lewycky
13e9bd6c11 Implement global.get and global.set.
`global.get` of const globals is not cached.
2020-05-06 15:08:42 -07:00
Nick Lewycky
187324b3d3 Add support for a function referring to its own bytes. 2020-05-05 14:15:39 -07:00
Nick Lewycky
50664f9aaa Produce a correct but minimal FunctionAddressMap.
Fixes debug_assert! firing in lookup_frame_info.
2020-05-05 13:57:47 -07:00
Nick Lewycky
fbeedbd3ac Wire up llvm code generated traps to the new runtime trap handler function. 2020-05-05 13:42:11 -07:00
Nick Lewycky
9d44735347 Fix function calls to themselves.
Previously fac-rec-named was emitting a call to fac-rec-named.1 due to LLVM auto-renaming the function.
2020-05-05 12:31:59 -07:00
Nick Lewycky
7465430868 Add support for relocations to other functions defined in the same module. 2020-05-05 11:47:17 -07:00
nlewycky
fdfb74abc2 Merge pull request #15 from wasmerio/rust-goblin
Replace llvm objectfile reader with goblin.
2020-05-04 20:52:57 -07:00
Nick Lewycky
830cebc91b Remove LLVM Object library-based .o reader. 2020-05-04 20:40:51 -07:00
Nick Lewycky
72899ccd47 Add support for libcalls. 2020-05-04 20:39:16 -07:00
Syrus
1363b98e47 Moved Unwind info a bit to make refactor easier 2020-05-04 20:37:28 -07:00
Nick Lewycky
df9e056b5b Replace object file loading code with an implementation based on top of goblin. 2020-05-04 19:57:23 -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
Nick Lewycky
359f89878f Add the correct number of locals when the same type is repeated. 2020-05-04 10:51:59 -07:00
Syrus
759561e0c5 Expose Compiler and CompilerConfig only on translator mode 2020-05-03 21:28:35 -07:00
Nick Lewycky
3a004b3e82 Fix build of compiler-llvm by growing the interface to SectionBody. 2020-05-03 16:08:05 -07:00
Syrus
45e2e210ea Imporved author names 2020-05-03 10:57:25 -07:00
Syrus
6a06af1b1b Simplified compiler config removing mutable features and target 2020-05-02 15:22:05 -07:00
Syrus
4e36cf987b Make compilers feature-configurable 2020-05-02 15:17:18 -07:00
Syrus
14061b9171 Fixed LLVM compilation 2020-05-02 14:51:51 -07:00
Syrus
deace5beb0 Renamed back into LocalFunc 2020-05-02 04:43:31 -07:00
Syrus
fdef870e5a Renamed UserFunc to ImportedFunc 2020-05-02 04:19:11 -07:00
Syrus
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
Syrus
20ad3d608f Fixed LLVM with new compiler structure 2020-05-01 22:04:33 -07:00
Nick Lewycky
4827434eef Build up list of per-function custom sections and build local relocations into them. 2020-05-01 16:31:26 -07:00
Syrus
cf70a297d8 Fixed compilation 2020-05-01 15:57:18 -07:00
Nick Lewycky
1227d50e9b Initial commit for support of custom sections. 2020-05-01 15:46:45 -07:00
Syrus
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
Nick Lewycky
b5d9b448ae Add support for libcalls as relocation targets. 2020-04-30 20:54:29 -07:00
Nick Lewycky
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