Generate trampolines based on signatures (#947)

* Generate trampolines based on signatures

Instead of generating a trampoline-per-function generate a
trampoline-per-signature. This should hopefully greatly increase the
cache hit rate on trampolines within a module and avoid generating a
function-per-function.

* Update crates/runtime/src/traphandlers.rs

Co-Authored-By: Sergei Pepyakin <s.pepyakin@gmail.com>

Co-authored-by: Sergei Pepyakin <s.pepyakin@gmail.com>
This commit is contained in:
Alex Crichton
2020-02-18 12:32:52 -06:00
committed by GitHub
parent c94cdc7730
commit 16affacafb
5 changed files with 58 additions and 53 deletions

View File

@@ -160,7 +160,7 @@ impl WrappedCallable for WasmtimeFn {
let exec_code_buf = self
.store
.compiler_mut()
.get_published_trampoline(body, &signature, value_size)
.get_published_trampoline(&signature, value_size)
.map_err(|e| Trap::new(format!("trampoline error: {:?}", e)))?;
// Call the trampoline.
@@ -169,6 +169,7 @@ impl WrappedCallable for WasmtimeFn {
vmctx,
ptr::null_mut(),
exec_code_buf,
body,
values_vec.as_mut_ptr() as *mut u8,
)
} {