summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Bernstein <max.bernstein@shopify.com>2025-02-12 12:47:04 -0500
committerTakashi Kokubun <takashikkbn@gmail.com>2025-04-18 21:52:58 +0900
commit7017e2ba77b0b33f07c00eae475c42a60b547ccc (patch)
tree4d8b48abc8e637964397976d40d37e6ae02d4b7d
parentc35931b5d593d201c5efa8499af36872a9c62369 (diff)
Compile sample exception code in ZJIT
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/13131
-rw-r--r--zjit/src/ir.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/zjit/src/ir.rs b/zjit/src/ir.rs
index b1364ca3e5..14057418c8 100644
--- a/zjit/src/ir.rs
+++ b/zjit/src/ir.rs
@@ -370,7 +370,8 @@ pub fn iseq_to_ssa(iseq: *const rb_iseq_t) -> Result<Function, ParseError> {
YARVINSN_nop => {},
YARVINSN_putnil => { state.push(Opnd::Const(Qnil)); },
YARVINSN_putobject => { state.push(Opnd::Const(get_arg(pc, 0))); },
- YARVINSN_putstring => {
+ YARVINSN_putstring | YARVINSN_putchilledstring => {
+ // TODO(max): Do something different for chilled string
let val = Opnd::Const(get_arg(pc, 0));
let insn_id = fun.push_insn(block, Insn::StringCopy { val });
state.push(Opnd::Insn(insn_id));
@@ -483,6 +484,11 @@ pub fn iseq_to_ssa(iseq: *const rb_iseq_t) -> Result<Function, ParseError> {
let left = state.pop()?;
state.push(Opnd::Insn(fun.push_insn(block, Insn::Send { self_val: left, call_info: CallInfo { name: "+".into() }, args: vec![right] })));
}
+ YARVINSN_opt_div => {
+ let right = state.pop()?;
+ let left = state.pop()?;
+ state.push(Opnd::Insn(fun.push_insn(block, Insn::Send { self_val: left, call_info: CallInfo { name: "/".into() }, args: vec![right] })));
+ }
YARVINSN_opt_lt => {
let right = state.pop()?;