summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Bernstein <max.bernstein@shopify.com>2025-02-07 10:36:26 -0500
committerTakashi Kokubun <takashikkbn@gmail.com>2025-04-18 21:52:57 +0900
commit03a56988e43b37dd29e9e2fc6e4ea69caaa28e6a (patch)
tree7bb987782b463ba2b4894231c874ad6905931141
parente60f84af0bb32686617c5be1c69dba555201d1bb (diff)
Add opt_send_without_block
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/13131
-rw-r--r--zjit/src/ir.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/zjit/src/ir.rs b/zjit/src/ir.rs
index b221ec728e..736951923e 100644
--- a/zjit/src/ir.rs
+++ b/zjit/src/ir.rs
@@ -285,7 +285,7 @@ fn compute_jump_targets(iseq: *const rb_iseq_t) -> Vec<u32> {
let offset = get_arg(pc, 0).as_i64();
jump_targets.insert(insn_idx_at_offset(insn_idx, offset));
}
- YARVINSN_leave => {
+ YARVINSN_leave | YARVINSN_opt_invokebuiltin_delegate_leave => {
if insn_idx < iseq_size {
jump_targets.insert(insn_idx);
}
@@ -440,10 +440,14 @@ pub fn iseq_to_ssa(iseq: *const rb_iseq_t) -> Function {
let mid = rb_vm_ci_mid(call_info);
cstr_to_rust_string(rb_id2name(mid)).unwrap_or_else(|| "<unknown>".to_owned())
};
+ let mut args = vec![];
+ for _ in 0..argc {
+ args.push(state.pop());
+ }
+ args.reverse();
- assert_eq!(0, argc, "really, it's pop(argc), and more, but idk how to do that yet");
let recv = state.pop();
- state.push(Opnd::Insn(fun.push_insn(block, Insn::Send { self_val: recv, call_info: CallInfo { name: method_name }, args: vec![] })));
+ state.push(Opnd::Insn(fun.push_insn(block, Insn::Send { self_val: recv, call_info: CallInfo { name: method_name }, args })));
}
_ => eprintln!("zjit: to_ssa: unknown opcode `{}'", insn_name(opcode as usize)),
}