diff options
| author | Max Bernstein <max.bernstein@shopify.com> | 2025-02-06 16:00:42 -0500 |
|---|---|---|
| committer | Takashi Kokubun <takashikkbn@gmail.com> | 2025-04-18 21:52:56 +0900 |
| commit | f7e6a2cf36d83224e69c7c8d5e7d6d019f9d69da (patch) | |
| tree | c8b4b061259ef49be27cb5259305382507d6f6fe | |
| parent | 7fd42d5fbe0b914cf7001029255fd7af4125c3d3 (diff) | |
Fake CallInfo
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/13131
| -rw-r--r-- | zjit/src/ir.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/zjit/src/ir.rs b/zjit/src/ir.rs index eda2f4c390..c961ec7412 100644 --- a/zjit/src/ir.rs +++ b/zjit/src/ir.rs @@ -46,6 +46,11 @@ pub struct BranchEdge { } #[derive(Debug, PartialEq)] +pub struct CallInfo { + name: String, +} + +#[derive(Debug, PartialEq)] pub enum Insn { // SSA block parameter. Also used for function parameters in the function's entry block. Param { idx: usize }, @@ -82,7 +87,7 @@ pub enum Insn { // Send with dynamic dispatch // Ignoring keyword arguments etc for now - Send { self_val: Opnd, args: Vec<Opnd> }, + Send { self_val: Opnd, call_info: CallInfo, args: Vec<Opnd> }, // Control flow instructions Return { val: Opnd }, @@ -362,6 +367,10 @@ pub fn iseq_to_ssa(iseq: *const rb_iseq_t) -> Function { } }); } + YARVINSN_opt_nil_p => { + let recv = state.pop(); + state.push(Opnd::Insn(fun.push_insn(block, Insn::Send { self_val: recv, call_info: CallInfo { name: "nil?".into() }, args: vec![] }))); + } YARVINSN_getlocal_WC_0 => { let val = state.getlocal(0); state.push(val); |
