diff options
author | Maxime Chevalier-Boisvert <[email protected]> | 2025-02-06 14:18:36 -0500 |
---|---|---|
committer | Takashi Kokubun <[email protected]> | 2025-04-18 21:52:56 +0900 |
commit | b5deaf85dd47aa84358bb35d58bca1c14f7850bd (patch) | |
tree | 6edff4450b1cdb73a98d91c54ea951084d6be199 | |
parent | d1b4bd4acac9df0e5fcc6097a44bc096fe1e69ac (diff) |
AllocArray => NewArray
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/13131
-rw-r--r-- | zjit/src/ir.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/zjit/src/ir.rs b/zjit/src/ir.rs index 29f737e65a..39835b4b3b 100644 --- a/zjit/src/ir.rs +++ b/zjit/src/ir.rs @@ -30,7 +30,7 @@ enum Insn { StringCopy { val: Opnd }, StringIntern { val: Opnd }, - AllocArray { count: usize }, + NewArray { count: usize }, ArraySet { idx: usize, val: Opnd }, //NewObject? @@ -151,7 +151,7 @@ fn to_ssa(opcodes: &Vec<RubyOpcode>) -> Function { state.push(Opnd::Insn(insn_id)); } RubyOpcode::Newarray(count) => { - let insn_id = result.push_insn(block, Insn::AllocArray { count: *count }); + let insn_id = result.push_insn(block, Insn::NewArray { count: *count }); for idx in (0..*count).rev() { result.push_insn(block, Insn::ArraySet { idx, val: state.pop() }); } @@ -204,7 +204,7 @@ pub fn iseq_to_ssa(iseq: *const rb_iseq_t) { } YARVINSN_newarray => { let count = get_arg(pc, 0).as_usize(); - let insn_id = result.push_insn(block, Insn::AllocArray { count }); + let insn_id = result.push_insn(block, Insn::NewArray { count }); for idx in (0..count).rev() { result.push_insn(block, Insn::ArraySet { idx, val: state.pop() }); } @@ -303,7 +303,7 @@ mod tests { assert_eq!(function, Function { entry_block: BlockId(0), insns: vec![ - Insn::AllocArray { count: 0 }, + Insn::NewArray { count: 0 }, Insn::Return { val: Opnd::Insn(InsnId(0)) } ], blocks: vec![ @@ -323,7 +323,7 @@ mod tests { assert_eq!(function, Function { entry_block: BlockId(0), insns: vec![ - Insn::AllocArray { count: 1 }, + Insn::NewArray { count: 1 }, Insn::ArraySet { idx: 0, val: Opnd::Const(Qnil) }, Insn::Return { val: Opnd::Insn(InsnId(0)) } ], @@ -347,7 +347,7 @@ mod tests { assert_eq!(function, Function { entry_block: BlockId(0), insns: vec![ - Insn::AllocArray { count: 2 }, + Insn::NewArray { count: 2 }, Insn::ArraySet { idx: 1, val: Opnd::Const(four) }, Insn::ArraySet { idx: 0, val: Opnd::Const(three) }, Insn::Return { val: Opnd::Insn(InsnId(0)) } |