diff options
| author | Max Bernstein <max.bernstein@shopify.com> | 2025-02-06 16:29:40 -0500 |
|---|---|---|
| committer | Takashi Kokubun <takashikkbn@gmail.com> | 2025-04-18 21:52:57 +0900 |
| commit | b6ac5cdefd5ebf786c2f0fcefe248bc6a773d156 (patch) | |
| tree | 2676b107974e0b758c3a23a5dbbbd20fe4548056 | |
| parent | a74615fcd7e9a5f1636a816e2d312709aaa60cfd (diff) | |
Fix s/[add|lt]/send/g
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/13131
| -rw-r--r-- | zjit/src/ir.rs | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/zjit/src/ir.rs b/zjit/src/ir.rs index a0af4a99c0..414e46a7a4 100644 --- a/zjit/src/ir.rs +++ b/zjit/src/ir.rs @@ -80,12 +80,6 @@ pub enum Insn { //SetIvar {}, //GetIvar {}, - // Operators - Add { v0: Opnd, v1: Opnd }, - - // Comparison operators - Lt { v0: Opnd, v1: Opnd }, - // Unconditional jump Jump(BranchEdge), @@ -156,7 +150,6 @@ impl std::fmt::Display for Function { Insn::Param { idx } => { write!(f, "Param {idx}")?; } Insn::IfFalse { val, target } => { write!(f, "IfFalse {val}, {target}")?; } Insn::Return { val } => { write!(f, "Return {val}")?; } - Insn::Add { v0, v1 } => { write!(f, "Add {v0}, {v1}")?; } Insn::Send { self_val, call_info, args } => { write!(f, "Send {self_val}, {}", call_info.name)?; for arg in args { @@ -357,19 +350,15 @@ pub fn iseq_to_ssa(iseq: *const rb_iseq_t) -> Function { } YARVINSN_opt_plus => { - // TODO: we need to add a BOP not redefined check here let v0 = state.pop(); let v1 = state.pop(); - let add_id = fun.push_insn(block, Insn::Add { v0, v1 }); - state.push(Opnd::Insn(add_id)); + state.push(Opnd::Insn(fun.push_insn(block, Insn::Send { self_val: v0, call_info: CallInfo { name: "+".into() }, args: vec![v1] }))); } YARVINSN_opt_lt => { - // TODO: we need to add a BOP not redefined check here let v0 = state.pop(); let v1 = state.pop(); - let lt_id = fun.push_insn(block, Insn::Lt { v0, v1 }); - state.push(Opnd::Insn(lt_id)); + state.push(Opnd::Insn(fun.push_insn(block, Insn::Send { self_val: v0, call_info: CallInfo { name: "<".into() }, args: vec![v1] }))); } YARVINSN_leave => { |
