diff options
| author | Max Bernstein <max.bernstein@shopify.com> | 2025-02-06 12:13:43 -0500 |
|---|---|---|
| committer | Takashi Kokubun <takashikkbn@gmail.com> | 2025-04-18 21:52:56 +0900 |
| commit | d091d6ea94e5a23346c30ea642d53bd00c90ee30 (patch) | |
| tree | bda9dcd392b089eee2a056626948b07583777862 | |
| parent | db14f4a16b818d4709553af8da8f9875d997a809 (diff) | |
Add swap
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/13131
| -rw-r--r-- | zjit/src/ir.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/zjit/src/ir.rs b/zjit/src/ir.rs index 170866bbba..27fbedc181 100644 --- a/zjit/src/ir.rs +++ b/zjit/src/ir.rs @@ -209,6 +209,12 @@ pub fn iseq_to_ssa(iseq: *const rb_iseq_t) { } YARVINSN_pop => { state.pop(); } YARVINSN_dup => { state.push(state.top()); } + YARVINSN_swap => { + let right = state.pop(); + let left = state.pop(); + state.push(right); + state.push(left); + } YARVINSN_leave => { result.push_insn(block, Insn::Return { val: state.pop() }); } |
