mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Add swap
This commit is contained in:
parent
db14f4a16b
commit
d091d6ea94
Notes:
git
2025-04-18 13:49:47 +00:00
1 changed files with 6 additions and 0 deletions
|
@ -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() });
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue