diff options
Diffstat (limited to 'yjit')
-rw-r--r-- | yjit/src/backend/ir.rs | 4 | ||||
-rw-r--r-- | yjit/src/codegen.rs | 4 | ||||
-rw-r--r-- | yjit/src/core.rs | 8 | ||||
-rw-r--r-- | yjit/src/utils.rs | 6 |
4 files changed, 10 insertions, 12 deletions
diff --git a/yjit/src/backend/ir.rs b/yjit/src/backend/ir.rs index dc0e450df4..ce82161693 100644 --- a/yjit/src/backend/ir.rs +++ b/yjit/src/backend/ir.rs @@ -796,9 +796,9 @@ impl Assembler } //pub fn pos_marker<F: FnMut(CodePtr)>(&mut self, marker_fn: F) - pub fn pos_marker(&mut self, marker_fn: PosMarkerFn) + pub fn pos_marker(&mut self, marker_fn: impl Fn(CodePtr) + 'static) { - self.push_insn(Op::PosMarker, vec![], None, None, Some(marker_fn)); + self.push_insn(Op::PosMarker, vec![], None, None, Some(Box::new(marker_fn))); } } diff --git a/yjit/src/codegen.rs b/yjit/src/codegen.rs index b34cc7409a..93d835d7f1 100644 --- a/yjit/src/codegen.rs +++ b/yjit/src/codegen.rs @@ -297,9 +297,9 @@ fn jit_prepare_routine_call( /// Record the current codeblock write position for rewriting into a jump into /// the outlined block later. Used to implement global code invalidation. fn record_global_inval_patch(asm: &mut Assembler, outline_block_target_pos: CodePtr) { - asm.pos_marker(Box::new(move |code_ptr| { + asm.pos_marker(move |code_ptr| { CodegenGlobals::push_global_inval_patch(code_ptr, outline_block_target_pos); - })); + }); } /// Verify the ctx's types and mappings against the compile-time stack, self, diff --git a/yjit/src/core.rs b/yjit/src/core.rs index 1afa5c537a..3b33360b90 100644 --- a/yjit/src/core.rs +++ b/yjit/src/core.rs @@ -1814,10 +1814,10 @@ impl Assembler // so that we can move the closure below let branchref = branchref.clone(); - self.pos_marker(Box::new(move |code_ptr| { + self.pos_marker(move |code_ptr| { let mut branch = branchref.borrow_mut(); branch.start_addr = Some(code_ptr); - })); + }); } // Mark the end position of a patchable branch in the machine code @@ -1827,10 +1827,10 @@ impl Assembler // so that we can move the closure below let branchref = branchref.clone(); - self.pos_marker(Box::new(move |code_ptr| { + self.pos_marker(move |code_ptr| { let mut branch = branchref.borrow_mut(); branch.end_addr = Some(code_ptr); - })); + }); } } diff --git a/yjit/src/utils.rs b/yjit/src/utils.rs index 5f42ba1fdb..bea57e4fc2 100644 --- a/yjit/src/utils.rs +++ b/yjit/src/utils.rs @@ -122,14 +122,12 @@ yjit_print_iseq(const rb_iseq_t *iseq) #[cfg(target_arch = "aarch64")] macro_rules! c_callable { - (fn $f:ident $args:tt -> $ret:ty $body:block) => { fn $f $args -> $ret $body }; - (fn $f:ident $args:tt $body:block) => { fn $f $args $body }; + (fn $f:ident $args:tt $(-> $ret:ty)? $body:block) => { extern "C" fn $f $args $(-> $ret)? $body }; } #[cfg(target_arch = "x86_64")] macro_rules! c_callable { - (fn $f:ident $args:tt -> $ret:ty $body:block) => { extern "sysv64" fn $f $args -> $ret $body }; - (fn $f:ident $args:tt $body:block) => { extern "sysv64" fn $f $args $body }; + (fn $f:ident $args:tt $(-> $ret:ty)? $body:block) => { extern "sysv64" fn $f $args $(-> $ret)? $body }; } pub(crate) use c_callable; |