Add public Compiler::get_published_trampoline (#243)

This commit is contained in:
Yury Delendik
2019-08-07 13:48:40 -05:00
committed by Dan Gohman
parent ecc9816870
commit 9263b9df40

View File

@@ -151,6 +151,18 @@ impl Compiler {
}) })
} }
/// Create and publish a trampoline for invoking a function.
pub fn get_published_trampoline(
&mut self,
callee_address: *const VMFunctionBody,
signature: &ir::Signature,
value_size: usize,
) -> Result<*const VMFunctionBody, SetupError> {
let result = self.get_trampoline(callee_address, signature, value_size)?;
self.publish_compiled_code();
Ok(result)
}
/// Make memory containing compiled code executable. /// Make memory containing compiled code executable.
pub(crate) fn publish_compiled_code(&mut self) { pub(crate) fn publish_compiled_code(&mut self) {
self.code_memory.publish(); self.code_memory.publish();