diff options
| author | Max Bernstein <max.bernstein@shopify.com> | 2025-02-06 11:56:45 -0500 |
|---|---|---|
| committer | Takashi Kokubun <takashikkbn@gmail.com> | 2025-04-18 21:52:56 +0900 |
| commit | a0e2502e183cbc699cfd18922dfc9ee1fede320f (patch) | |
| tree | e3fb22d1778f5c4bb481e2b6ea7e45c385ea19ba | |
| parent | 64287c95caceb2d00b49d68946e0de5df0a642bf (diff) | |
Add other real yarv insns
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/13131
| -rw-r--r-- | zjit/src/ir.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/zjit/src/ir.rs b/zjit/src/ir.rs index 43d43fe66b..278a1767b7 100644 --- a/zjit/src/ir.rs +++ b/zjit/src/ir.rs @@ -177,6 +177,24 @@ fn iseq_to_ssa(iseq: *const rb_iseq_t) -> Function { match opcode { YARVINSN_putnil => { state.push(Opnd::Const(Qnil)); }, YARVINSN_putobject => { state.push(Opnd::Const(get_arg(pc, 0))); }, + YARVINSN_putstring => { + let val = Opnd::Const(get_arg(pc, 0)); + let insn_id = result.push_insn(block, Insn::StringCopy { val }); + state.push(Opnd::Insn(insn_id)); + } + YARVINSN_intern => { + let val = state.pop(); + let insn_id = result.push_insn(block, Insn::StringIntern { val }); + state.push(Opnd::Insn(insn_id)); + } + YARVINSN_newarray => { + let count = get_arg(pc, 0).as_usize(); + let insn_id = result.push_insn(block, Insn::AllocArray { count }); + for idx in (0..count).rev() { + result.push_insn(block, Insn::ArraySet { idx, val: state.pop() }); + } + state.push(Opnd::Insn(insn_id)); + } YARVINSN_setlocal_WC_0 => { let val = state.pop(); state.setlocal(0, val); |
