diff options
| author | nozomemein <b8yukifsukeo999n@gmail.com> | 2026-01-15 07:18:31 +0900 |
|---|---|---|
| committer | Takashi Kokubun <takashikkbn@gmail.com> | 2026-01-15 09:00:53 -0800 |
| commit | ce390f19954edda3874ed62768440953b40be0da (patch) | |
| tree | 53a553baad467d83405e1d2b91db92efd2f58841 /zjit | |
| parent | 844f072ce16235c0f10df73bb79d40cc01223c28 (diff) | |
Diffstat (limited to 'zjit')
| -rw-r--r-- | zjit/src/hir.rs | 3 | ||||
| -rw-r--r-- | zjit/src/hir/tests.rs | 10 |
2 files changed, 5 insertions, 8 deletions
diff --git a/zjit/src/hir.rs b/zjit/src/hir.rs index b4608d3380..97a0097073 100644 --- a/zjit/src/hir.rs +++ b/zjit/src/hir.rs @@ -6545,10 +6545,9 @@ pub fn iseq_to_hir(iseq: *const rb_iseq_t) -> Result<Function, ParseError> { let length = fun.push_insn(block, Insn::ArrayLength { array }); fun.push_insn(block, Insn::GuardBitEquals { val: length, expected: Const::CInt64(num as i64), reason: SideExitReason::ExpandArray, state: exit_id }); for i in (0..num).rev() { - let index = fun.push_insn(block, Insn::Const { val: Const::Value(VALUE::fixnum_from_usize(i.try_into().unwrap())) }); // We do not emit a length guard here because in-bounds is already // ensured by the expandarray length check above. - let index = fun.push_insn(block, Insn::UnboxFixnum { val: index }); + let index = fun.push_insn(block, Insn::Const { val: Const::CInt64(i.try_into().unwrap()) }); let element = fun.push_insn(block, Insn::ArrayAref { array, index }); state.stack_push(element); } diff --git a/zjit/src/hir/tests.rs b/zjit/src/hir/tests.rs index b4bd9cbc31..1ce5488f47 100644 --- a/zjit/src/hir/tests.rs +++ b/zjit/src/hir/tests.rs @@ -3565,12 +3565,10 @@ pub mod hir_build_tests { v21:ArrayExact = GuardType v13, ArrayExact v22:CInt64 = ArrayLength v21 v23:CInt64[2] = GuardBitEquals v22, CInt64(2) - v24:Fixnum[1] = Const Value(1) - v25:CInt64[1] = UnboxFixnum v24 - v26:BasicObject = ArrayAref v21, v25 - v27:Fixnum[0] = Const Value(0) - v28:CInt64[0] = UnboxFixnum v27 - v29:BasicObject = ArrayAref v21, v28 + v24:CInt64[1] = Const CInt64(1) + v25:BasicObject = ArrayAref v21, v24 + v26:CInt64[0] = Const CInt64(0) + v27:BasicObject = ArrayAref v21, v26 PatchPoint NoEPEscape(test) CheckInterrupts Return v13 |
