summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--zjit/src/codegen.rs2
-rw-r--r--zjit/src/cruby_methods.rs12
-rw-r--r--zjit/src/hir.rs6
3 files changed, 12 insertions, 8 deletions
diff --git a/zjit/src/codegen.rs b/zjit/src/codegen.rs
index 3ba90851db..e9949705fc 100644
--- a/zjit/src/codegen.rs
+++ b/zjit/src/codegen.rs
@@ -539,7 +539,7 @@ fn gen_insn(cb: &mut CodeBlock, jit: &mut JITState, asm: &mut Assembler, functio
&Insn::GuardAnyBitSet { val, mask, reason, state, .. } => gen_guard_any_bit_set(jit, asm, opnd!(val), mask, reason, &function.frame_state(state)),
&Insn::GuardNoBitsSet { val, mask, reason, state, .. } => gen_guard_no_bits_set(jit, asm, opnd!(val), mask, reason, &function.frame_state(state)),
&Insn::GuardLess { left, right, state } => gen_guard_less(jit, asm, opnd!(left), opnd!(right), &function.frame_state(state)),
- &Insn::GuardGreaterEq { left, right, state } => gen_guard_greater_eq(jit, asm, opnd!(left), opnd!(right), &function.frame_state(state)),
+ &Insn::GuardGreaterEq { left, right, state, .. } => gen_guard_greater_eq(jit, asm, opnd!(left), opnd!(right), &function.frame_state(state)),
Insn::PatchPoint { invariant, state } => no_output!(gen_patch_point(jit, asm, invariant, &function.frame_state(*state))),
Insn::CCall { cfunc, recv, args, name, return_type: _, elidable: _ } => gen_ccall(asm, *cfunc, *name, opnd!(recv), opnds!(args)),
// Give up CCallWithFrame for 7+ args since asm.ccall() supports at most 6 args (recv + args).
diff --git a/zjit/src/cruby_methods.rs b/zjit/src/cruby_methods.rs
index 8596472f5a..aeca0e36bd 100644
--- a/zjit/src/cruby_methods.rs
+++ b/zjit/src/cruby_methods.rs
@@ -336,7 +336,8 @@ fn inline_array_aref(fun: &mut hir::Function, block: hir::BlockId, recv: hir::In
let length = fun.push_insn(block, hir::Insn::ArrayLength { array: recv });
let index = fun.push_insn(block, hir::Insn::GuardLess { left: index, right: length, state });
let zero = fun.push_insn(block, hir::Insn::Const { val: hir::Const::CInt64(0) });
- let index = fun.push_insn(block, hir::Insn::GuardGreaterEq { left: index, right: zero, state });
+ use crate::hir::SideExitReason;
+ let index = fun.push_insn(block, hir::Insn::GuardGreaterEq { left: index, right: zero, reason: SideExitReason::GuardGreaterEq, state });
let result = fun.push_insn(block, hir::Insn::ArrayAref { array: recv, index });
return Some(result);
}
@@ -359,7 +360,8 @@ fn inline_array_aset(fun: &mut hir::Function, block: hir::BlockId, recv: hir::In
let length = fun.push_insn(block, hir::Insn::ArrayLength { array: recv });
let index = fun.push_insn(block, hir::Insn::GuardLess { left: index, right: length, state });
let zero = fun.push_insn(block, hir::Insn::Const { val: hir::Const::CInt64(0) });
- let index = fun.push_insn(block, hir::Insn::GuardGreaterEq { left: index, right: zero, state });
+ use crate::hir::SideExitReason;
+ let index = fun.push_insn(block, hir::Insn::GuardGreaterEq { left: index, right: zero, reason: SideExitReason::GuardGreaterEq, state });
let _ = fun.push_insn(block, hir::Insn::ArrayAset { array: recv, index, val });
fun.push_insn(block, hir::Insn::WriteBarrier { recv, val });
@@ -451,7 +453,8 @@ fn inline_string_getbyte(fun: &mut hir::Function, block: hir::BlockId, recv: hir
// This is unlike most other guards.
let unboxed_index = fun.push_insn(block, hir::Insn::GuardLess { left: unboxed_index, right: len, state });
let zero = fun.push_insn(block, hir::Insn::Const { val: hir::Const::CInt64(0) });
- let _ = fun.push_insn(block, hir::Insn::GuardGreaterEq { left: unboxed_index, right: zero, state });
+ use crate::hir::SideExitReason;
+ let _ = fun.push_insn(block, hir::Insn::GuardGreaterEq { left: unboxed_index, right: zero, reason: SideExitReason::GuardGreaterEq, state });
let result = fun.push_insn(block, hir::Insn::StringGetbyte { string: recv, index: unboxed_index });
return Some(result);
}
@@ -473,7 +476,8 @@ fn inline_string_setbyte(fun: &mut hir::Function, block: hir::BlockId, recv: hir
});
let unboxed_index = fun.push_insn(block, hir::Insn::GuardLess { left: unboxed_index, right: len, state });
let zero = fun.push_insn(block, hir::Insn::Const { val: hir::Const::CInt64(0) });
- let _ = fun.push_insn(block, hir::Insn::GuardGreaterEq { left: unboxed_index, right: zero, state });
+ use crate::hir::SideExitReason;
+ let _ = fun.push_insn(block, hir::Insn::GuardGreaterEq { left: unboxed_index, right: zero, reason: SideExitReason::GuardGreaterEq, state });
// We know that all String are HeapObject, so no need to insert a GuardType(HeapObject).
fun.guard_not_frozen(block, recv, state);
let _ = fun.push_insn(block, hir::Insn::StringSetbyteFixnum { string: recv, index, value });
diff --git a/zjit/src/hir.rs b/zjit/src/hir.rs
index 65f7c3396b..63d68d9a44 100644
--- a/zjit/src/hir.rs
+++ b/zjit/src/hir.rs
@@ -1031,7 +1031,7 @@ pub enum Insn {
/// Side-exit if (val & mask) != 0
GuardNoBitsSet { val: InsnId, mask: Const, mask_name: Option<ID>, reason: SideExitReason, state: InsnId },
/// Side-exit if left is not greater than or equal to right (both operands are C long).
- GuardGreaterEq { left: InsnId, right: InsnId, state: InsnId },
+ GuardGreaterEq { left: InsnId, right: InsnId, reason: SideExitReason, state: InsnId },
/// Side-exit if left is not less than right (both operands are C long).
GuardLess { left: InsnId, right: InsnId, state: InsnId },
@@ -2240,7 +2240,7 @@ impl Function {
&GuardBitEquals { val, expected, reason, state } => GuardBitEquals { val: find!(val), expected, reason, state },
&GuardAnyBitSet { val, mask, mask_name, reason, state } => GuardAnyBitSet { val: find!(val), mask, mask_name, reason, state },
&GuardNoBitsSet { val, mask, mask_name, reason, state } => GuardNoBitsSet { val: find!(val), mask, mask_name, reason, state },
- &GuardGreaterEq { left, right, state } => GuardGreaterEq { left: find!(left), right: find!(right), state },
+ &GuardGreaterEq { left, right, reason, state } => GuardGreaterEq { left: find!(left), right: find!(right), reason, state },
&GuardLess { left, right, state } => GuardLess { left: find!(left), right: find!(right), state },
&IsBlockGiven { lep } => IsBlockGiven { lep: find!(lep) },
&GetBlockParam { level, ep_offset, state } => GetBlockParam { level, ep_offset, state: find!(state) },
@@ -4775,7 +4775,7 @@ impl Function {
worklist.push_back(val);
worklist.push_back(state);
}
- &Insn::GuardGreaterEq { left, right, state } => {
+ &Insn::GuardGreaterEq { left, right, state, .. } => {
worklist.push_back(left);
worklist.push_back(right);
worklist.push_back(state);