diff options
author | Alan Wu <XrXr@users.noreply.github.com> | 2022-07-28 11:08:30 -0400 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2022-08-29 08:47:05 -0700 |
commit | 869b0ba6e00168d739830af766c3abb0dec01f12 (patch) | |
tree | b3aa712b59913cec94aacde99cead910075979d6 /yjit/src/backend/ir.rs | |
parent | 6ab71a8598c6eece25975ca262eb880462e47b06 (diff) | |
download | ruby-869b0ba6e00168d739830af766c3abb0dec01f12.tar.gz |
Minor cleanups (https://github.com/Shopify/ruby/pull/345)
* Move allocation into Assembler::pos_marker
We wanted to do this to begin with but didn't because we were confused
about the lifetime parameter. It's actually talking about the lifetime
of the references that the closure captures. Since all of our usages
capture no references (they use `move`), it's fine to put a `+ 'static`
here.
* Use optional token syntax for calling convention macro
* Explicitly request C ABI on ARM
It looks like the Rust calling convention for functions are the same as
the C ABI for now and it's unlikely to change, but it's easy for us to
be explicit here. I also tried saying `extern "aapcs"` but that
unfortunately doesn't work.
Diffstat (limited to 'yjit/src/backend/ir.rs')
-rw-r--r-- | yjit/src/backend/ir.rs | 4 |
1 files changed, 2 insertions, 2 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))); } } |