diff options
| author | Alan Wu <XrXr@users.noreply.github.com> | 2025-02-06 16:30:58 -0500 |
|---|---|---|
| committer | Takashi Kokubun <takashikkbn@gmail.com> | 2025-04-18 21:52:57 +0900 |
| commit | e19ccddb9bc9fb2fc037f51ee64e1fb8eb1f04db (patch) | |
| tree | 846658448f277e49df46c52aeee4266f1886d273 | |
| parent | a93ff3616115688f5b96ec926e32f39522f80d78 (diff) | |
YARVINSN_opt_send_without_block, can do `-e nil.itself`
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/13131
| -rw-r--r-- | zjit/src/ir.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/zjit/src/ir.rs b/zjit/src/ir.rs index 414e46a7a4..ce0409eda2 100644 --- a/zjit/src/ir.rs +++ b/zjit/src/ir.rs @@ -364,6 +364,22 @@ pub fn iseq_to_ssa(iseq: *const rb_iseq_t) -> Function { YARVINSN_leave => { fun.push_insn(block, Insn::Return { val: state.pop() }); } + + YARVINSN_opt_send_without_block => { + let cd: *const rb_call_data = get_arg(pc, 0).as_ptr(); + let call_info = unsafe { rb_get_call_data_ci(cd) }; + let argc = unsafe { vm_ci_argc((*cd).ci) }; + + + let method_name = unsafe { + let mid = rb_vm_ci_mid(call_info); + cstr_to_rust_string(rb_id2name(mid)).unwrap_or_else(|| "<unknown>".to_owned()) + }; + + 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![] }))); + } _ => eprintln!("zjit: to_ssa: unknown opcode `{}'", insn_name(opcode as usize)), } } |
