Commit Graph

98 Commits

Author SHA1 Message Date
8f539d134b Move wasmer_compiler/{address_map, function, module, sourceloc, trap, unwind}.rs to wasmer_types 2022-06-16 16:57:45 +03:00
b1f1939bf7 Move wasmer_compiler/{section,relocation}.rs to wasmer_types 2022-06-16 16:57:45 +03:00
feee4e3587 Move wasmer_compiler errors to wasmer_types error module 2022-06-16 16:57:45 +03:00
5339f7cdae Fix clippy lints
Fixes: #2926
2022-06-09 16:05:53 +02:00
00f9a3c8d7 Remove loupe dependency
Closes #2731
Closes #2744
2022-06-08 14:12:49 +03:00
ffb9cd33b9 Use trampolines for all libcalls in engine-universal and engine-dylib
In both of these engines, the compiled code may be loaded in memory far
from the Wasmer runtime which means that libcalls may not be reachable
through the normal relocation types. Instead a trampoline is needed to
allow reaching any address in the 64-bit address space.

In the case of engine-dylib, this is even worse since the symbols are
not exported by the executable without some special linker flags. The
solution here is to manually patch in the addresses at load time into
a data table of function pointers.
2022-01-20 11:47:20 +00:00
78eb5bc4c0 Fix alignment of WASMER_METADATA in the dylib engine
rykv requires this to be at least 16-byte aligned.
2022-01-04 16:23:49 +01:00
8c24ab48db Some last small changes 2021-10-18 11:55:42 +02:00
b54780cdab feat(compiler) Refactor the new ARM Reloc and Trampoline to avoid a &mut 2021-10-12 10:11:36 +02:00
0c6010ca34 feat(compiler) Use x17 as scratch instead of x16 on Aarch64 to help with Apple ABI 2021-10-08 16:19:31 +02:00
20f0c66fe6 feat(compiler) Added Trampolines and more Relocations for Arm64 (llvm-universal on linux-aarch64 are OK now) 2021-10-05 14:08:55 +02:00
cb66b5293d Improved middleware logic 2021-04-27 14:00:25 -07:00
2df5854e37 Make compilers to take non-mutable inputs 2021-04-26 21:14:23 -07:00
b832de05df Simplifies a few pattern-matches
... which have a direct combinator equivalent on Option / Result.

Tool-aided by [comby-rust](https://github.com/huitseeker/comby-rust).
2021-03-24 07:18:26 -07:00
2afed4d813 feat: Use latest version of loupe. 2021-03-22 11:43:46 +01:00
026520998c feat: Start implementing loupe::MemoryUsage on wasmer::Store. 2021-03-22 11:42:28 +01:00
71b9feff08 Use ParallelBridge to remove copies of data out of PrimaryMap. 2021-01-22 13:36:45 -08:00
ec6c990663 Do all three mapping operations in a single thread pool. 2021-01-22 13:30:21 -08:00
184edbe7e4 Add a TODO referring to a feature request on Rayon. 2021-01-21 22:14:04 -08:00
fffdde0217 Apply rustfmt changes that the CI brought up. 2021-01-21 17:31:40 -08:00
8ee2cf55ad Improve parallelism of llvm builds with native or object file engine. 2021-01-21 17:27:34 -08:00
13e6f29c29 Set compiler config to be owned (following wasm-c-api) 2020-12-04 02:39:19 -08:00
8ca3693a56 Add support for middleware to experimental_native_compile_module and make it work on compiler-llvm. 2020-11-23 13:56:17 -08:00
9d8f315d4c Update module info in-place. 2020-11-23 13:42:51 -08:00
9bd2c47730 Upgraded Cranelift to 0.67 2020-10-29 20:19:16 -07:00
e4981c4f66 Add a get_abi(TargetMachine) method instead of creating X86_64SystemV directly.
A new Arm64Linux ABI is added but it's an unedited copy of the X86_64SystemV one so far.

A bunch of cleanups from clippy. Use matches! more, don't pass &Box<dyn Abi>.
2020-10-20 14:46:45 -07:00
5d40787856 Add a compiler-llvm CompilerFunctionKind for the whole module which can occur with the experimental API for engine-native.
Since it's no longer per-function, rename CompilerFunctionKind to CompilerKind.
2020-08-20 23:28:07 -07:00
91414df670 NFC. Import the inkwell::DLLStorageClass name. 2020-08-18 14:20:45 -07:00
9c5e682585 Export the wasmer metadata when building a DLL. 2020-08-18 14:18:07 -07:00
9e89ee9b7b Call a callback to emit the merged object file. 2020-08-17 23:21:36 -07:00
6e974b92cd Run cargo fmt 2020-08-13 18:12:43 -07:00
5049c543dc Rename wasm-common crate to wasmer-types 2020-08-13 17:59:26 -07:00
15b3a35e0c Don't clone function body data. 2020-08-07 14:31:36 -07:00
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
701973ffae Make Native Engine work with conditional native compilation 2020-08-07 11:35:42 -07:00
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
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
02c62657f5 Add experimental_native_compile_module and initial implementation changing native engine to use it. 2020-08-05 17:12:17 -07:00
bf0df80551 Rename CompilationNamer to SymbolRegistry.
SymbolRegistry is invertible so we can remove the wrappers.
2020-08-05 15:07:56 -07:00
9ca46f4f2d Include trampolines in the generated object file. 2020-08-05 14:20:47 -07:00
0b62c775de Verify the post-merge bitcode before codegen. 2020-08-05 12:12:47 -07:00
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
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
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
a732159514 Use better naming for module functions 2020-07-26 12:02:45 -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
84b32ed2cd cargo fmt 2020-06-18 16:46:45 -07:00