From 9263b9df40d67a6068b63a899d65e391f6ec2c5b Mon Sep 17 00:00:00 2001 From: Yury Delendik Date: Wed, 7 Aug 2019 13:48:40 -0500 Subject: [PATCH] Add public Compiler::get_published_trampoline (#243) --- wasmtime-jit/src/compiler.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/wasmtime-jit/src/compiler.rs b/wasmtime-jit/src/compiler.rs index 7d4c456dac..b3a6c4ea4e 100644 --- a/wasmtime-jit/src/compiler.rs +++ b/wasmtime-jit/src/compiler.rs @@ -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. pub(crate) fn publish_compiled_code(&mut self) { self.code_memory.publish();