Swap code lazily when tiering up from singlepass to LLVM.

Does not handle long-running functions, but should work at least.
This commit is contained in:
losfair
2019-08-09 04:26:17 +08:00
parent 0d604b754b
commit c1619026d5
10 changed files with 350 additions and 94 deletions

View File

@@ -151,6 +151,10 @@ pub trait RunnableModule: Send + Sync {
None
}
unsafe fn patch_local_function(&self, _idx: usize, _target_address: usize) -> bool {
false
}
/// A wasm trampoline contains the necessary data to dynamically call an exported wasm function.
/// Given a particular signature index, we are returned a trampoline that is matched with that
/// signature and an invoke function that can call the trampoline.
@@ -167,6 +171,11 @@ pub trait RunnableModule: Send + Sync {
fn get_offsets(&self) -> Option<Vec<usize>> {
None
}
/// Returns the beginning offsets of all local functions.
fn get_local_function_offsets(&self) -> Option<Vec<usize>> {
None
}
}
pub trait CacheGen: Send + Sync {