summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2026-01-29 14:59:33 -0500
committerAlan Wu <XrXr@users.noreply.github.com>2026-01-29 15:30:33 -0500
commitcfa3a4a7d1e9552e9105b4e9ae13b349a5c78b20 (patch)
tree4e37507069fe4d8dbc1215541c9d36dd7c768ebc
parentacc414572c213f2690eee56bac3d2355a24e5930 (diff)
ZJIT: Make printout and identifier name consistent for `Guard{AnyBit,NoBits}Set`
-rw-r--r--zjit/src/hir.rs4
-rw-r--r--zjit/src/hir/opt_tests.rs22
-rw-r--r--zjit/src/hir/tests.rs12
3 files changed, 19 insertions, 19 deletions
diff --git a/zjit/src/hir.rs b/zjit/src/hir.rs
index 3c96f1d3aa..8a9d5a5bb0 100644
--- a/zjit/src/hir.rs
+++ b/zjit/src/hir.rs
@@ -1554,8 +1554,8 @@ impl<'a> std::fmt::Display for InsnPrinter<'a> {
Insn::HasType { val, expected, .. } => { write!(f, "HasType {val}, {}", expected.print(self.ptr_map)) },
Insn::GuardTypeNot { val, guard_type, .. } => { write!(f, "GuardTypeNot {val}, {}", guard_type.print(self.ptr_map)) },
Insn::GuardBitEquals { val, expected, .. } => { write!(f, "GuardBitEquals {val}, {}", expected.print(self.ptr_map)) },
- Insn::GuardAnyBitSet { val, mask, .. } => { write!(f, "GuardBitSet {val}, {}", mask.print(self.ptr_map)) },
- Insn::GuardNoBitsSet { val, mask, .. } => { write!(f, "GuardBitNotSet {val}, {}", mask.print(self.ptr_map)) },
+ Insn::GuardAnyBitSet { val, mask, .. } => { write!(f, "GuardAnyBitSet {val}, {}", mask.print(self.ptr_map)) },
+ Insn::GuardNoBitsSet { val, mask, .. } => { write!(f, "GuardNoBitsSet {val}, {}", mask.print(self.ptr_map)) },
&Insn::GuardShape { val, shape, .. } => { write!(f, "GuardShape {val}, {:p}", self.ptr_map.map_shape(shape)) },
Insn::GuardNotFrozen { recv, .. } => write!(f, "GuardNotFrozen {recv}"),
Insn::GuardNotShared { recv, .. } => write!(f, "GuardNotShared {recv}"),
diff --git a/zjit/src/hir/opt_tests.rs b/zjit/src/hir/opt_tests.rs
index a8a1a617a3..29b1e36331 100644
--- a/zjit/src/hir/opt_tests.rs
+++ b/zjit/src/hir/opt_tests.rs
@@ -3875,7 +3875,7 @@ mod hir_opt_tests {
eval("
def test(&block) = tap(&block)
");
- assert_snapshot!(hir_string("test"), @"
+ assert_snapshot!(hir_string("test"), @r"
fn test@<compiled>:2:
bb0():
EntryPoint interpreter
@@ -3888,9 +3888,9 @@ mod hir_opt_tests {
bb2(v8:BasicObject, v9:BasicObject):
v14:CPtr = GetEP 0
v15:CInt64 = LoadField v14, :_env_data_index_flags@0x1000
- v16:CInt64 = GuardBitNotSet v15, CUInt64(512)
+ v16:CInt64 = GuardNoBitsSet v15, CUInt64(512)
v17:CInt64 = LoadField v14, :_env_data_index_specval@0x1001
- v18:CInt64 = GuardBitSet v17, CUInt64(1)
+ v18:CInt64 = GuardAnyBitSet v17, CUInt64(1)
v19:HeapObject[BlockParamProxy] = Const Value(VALUE(0x1008))
v21:BasicObject = Send v8, 0x1010, :tap, v19 # SendFallbackReason: Uncategorized(send)
CheckInterrupts
@@ -6546,7 +6546,7 @@ mod hir_opt_tests {
def test(&block) = [].map(&block)
test { |x| x }; test { |x| x }
"#);
- assert_snapshot!(hir_string("test"), @"
+ assert_snapshot!(hir_string("test"), @r"
fn test@<compiled>:2:
bb0():
EntryPoint interpreter
@@ -6560,9 +6560,9 @@ mod hir_opt_tests {
v13:ArrayExact = NewArray
v15:CPtr = GetEP 0
v16:CInt64 = LoadField v15, :_env_data_index_flags@0x1000
- v17:CInt64 = GuardBitNotSet v16, CUInt64(512)
+ v17:CInt64 = GuardNoBitsSet v16, CUInt64(512)
v18:CInt64 = LoadField v15, :_env_data_index_specval@0x1001
- v19:CInt64 = GuardBitSet v18, CUInt64(1)
+ v19:CInt64 = GuardAnyBitSet v18, CUInt64(1)
v20:HeapObject[BlockParamProxy] = Const Value(VALUE(0x1008))
IncrCounter complex_arg_pass_caller_blockarg
v22:BasicObject = Send v13, 0x1010, :map, v20 # SendFallbackReason: Complex argument passing
@@ -6577,7 +6577,7 @@ mod hir_opt_tests {
def test(&block) = [].map(&block)
test; test
"#);
- assert_snapshot!(hir_string("test"), @"
+ assert_snapshot!(hir_string("test"), @r"
fn test@<compiled>:2:
bb0():
EntryPoint interpreter
@@ -6591,7 +6591,7 @@ mod hir_opt_tests {
v13:ArrayExact = NewArray
v15:CPtr = GetEP 0
v16:CInt64 = LoadField v15, :_env_data_index_flags@0x1000
- v17:CInt64 = GuardBitNotSet v16, CUInt64(512)
+ v17:CInt64 = GuardNoBitsSet v16, CUInt64(512)
v18:CInt64 = LoadField v15, :_env_data_index_specval@0x1001
v19:CInt64[0] = GuardBitEquals v18, CInt64(0)
v20:NilClass = Const Value(nil)
@@ -6612,7 +6612,7 @@ mod hir_opt_tests {
end
test; test
"#);
- assert_snapshot!(hir_string_proc("test"), @"
+ assert_snapshot!(hir_string_proc("test"), @r"
fn block in test@<compiled>:4:
bb0():
EntryPoint interpreter
@@ -6625,9 +6625,9 @@ mod hir_opt_tests {
v10:ArrayExact = NewArray
v12:CPtr = GetEP 1
v13:CInt64 = LoadField v12, :_env_data_index_flags@0x1000
- v14:CInt64 = GuardBitNotSet v13, CUInt64(512)
+ v14:CInt64 = GuardNoBitsSet v13, CUInt64(512)
v15:CInt64 = LoadField v12, :_env_data_index_specval@0x1001
- v16:CInt64 = GuardBitSet v15, CUInt64(1)
+ v16:CInt64 = GuardAnyBitSet v15, CUInt64(1)
v17:HeapObject[BlockParamProxy] = Const Value(VALUE(0x1008))
IncrCounter complex_arg_pass_caller_blockarg
v19:BasicObject = Send v10, 0x1010, :map, v17 # SendFallbackReason: Complex argument passing
diff --git a/zjit/src/hir/tests.rs b/zjit/src/hir/tests.rs
index dbab964976..5b97a61d80 100644
--- a/zjit/src/hir/tests.rs
+++ b/zjit/src/hir/tests.rs
@@ -2038,7 +2038,7 @@ pub mod hir_build_tests {
eval("
def test(a, ...) = foo(a, ...)
");
- assert_snapshot!(hir_string("test"), @"
+ assert_snapshot!(hir_string("test"), @r"
fn test@<compiled>:2:
bb0():
EntryPoint interpreter
@@ -2058,9 +2058,9 @@ pub mod hir_build_tests {
PatchPoint NoEPEscape(test)
v33:CPtr = GetEP 0
v34:CInt64 = LoadField v33, :_env_data_index_flags@0x1000
- v35:CInt64 = GuardBitNotSet v34, CUInt64(512)
+ v35:CInt64 = GuardNoBitsSet v34, CUInt64(512)
v36:CInt64 = LoadField v33, :_env_data_index_specval@0x1001
- v37:CInt64 = GuardBitSet v36, CUInt64(1)
+ v37:CInt64 = GuardAnyBitSet v36, CUInt64(1)
v38:HeapObject[BlockParamProxy] = Const Value(VALUE(0x1008))
SideExit UnhandledYARVInsn(splatkw)
");
@@ -3413,7 +3413,7 @@ pub mod hir_build_tests {
let iseq = crate::cruby::with_rubyvm(|| get_method_iseq("Dir", "open"));
assert!(iseq_contains_opcode(iseq, YARVINSN_opt_invokebuiltin_delegate), "iseq Dir.open does not contain invokebuiltin");
let function = iseq_to_hir(iseq).unwrap();
- assert_snapshot!(hir_string_function(&function), @"
+ assert_snapshot!(hir_string_function(&function), @r"
fn open@<internal:dir>:
bb0():
EntryPoint interpreter
@@ -3434,9 +3434,9 @@ pub mod hir_build_tests {
PatchPoint NoEPEscape(open)
v31:CPtr = GetEP 0
v32:CInt64 = LoadField v31, :_env_data_index_flags@0x1000
- v33:CInt64 = GuardBitNotSet v32, CUInt64(512)
+ v33:CInt64 = GuardNoBitsSet v32, CUInt64(512)
v34:CInt64 = LoadField v31, :_env_data_index_specval@0x1001
- v35:CInt64 = GuardBitSet v34, CUInt64(1)
+ v35:CInt64 = GuardAnyBitSet v34, CUInt64(1)
v36:HeapObject[BlockParamProxy] = Const Value(VALUE(0x1008))
CheckInterrupts
v39:CBool[true] = Test v36