summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Menard <kevin@nirvdrum.com>2025-11-17 11:41:30 -0500
committerMax Bernstein <tekknolagi@gmail.com>2025-11-20 14:35:09 -0800
commit7d2f9ab9e1992dded620fe221421c9c247dcd408 (patch)
tree50534f9121efb220ec7f3ec66b6c88d8d59364b1
parentb06dd644da0ae87f33649ade6fc827a301b55b0c (diff)
ZJIT: Handle display formatting for all defined bops
-rw-r--r--zjit/src/hir.rs50
-rw-r--r--zjit/src/hir/tests.rs6
2 files changed, 37 insertions, 19 deletions
diff --git a/zjit/src/hir.rs b/zjit/src/hir.rs
index 4232410f23..172b177c45 100644
--- a/zjit/src/hir.rs
+++ b/zjit/src/hir.rs
@@ -217,22 +217,40 @@ impl<'a> std::fmt::Display for InvariantPrinter<'a> {
}
write!(f, ", ")?;
match bop {
- BOP_PLUS => write!(f, "BOP_PLUS")?,
- BOP_MINUS => write!(f, "BOP_MINUS")?,
- BOP_MULT => write!(f, "BOP_MULT")?,
- BOP_DIV => write!(f, "BOP_DIV")?,
- BOP_MOD => write!(f, "BOP_MOD")?,
- BOP_EQ => write!(f, "BOP_EQ")?,
- BOP_NEQ => write!(f, "BOP_NEQ")?,
- BOP_LT => write!(f, "BOP_LT")?,
- BOP_LE => write!(f, "BOP_LE")?,
- BOP_GT => write!(f, "BOP_GT")?,
- BOP_GE => write!(f, "BOP_GE")?,
- BOP_FREEZE => write!(f, "BOP_FREEZE")?,
- BOP_UMINUS => write!(f, "BOP_UMINUS")?,
- BOP_MAX => write!(f, "BOP_MAX")?,
- BOP_HASH => write!(f, "BOP_HASH")?,
- BOP_AREF => write!(f, "BOP_AREF")?,
+ BOP_PLUS => write!(f, "BOP_PLUS")?,
+ BOP_MINUS => write!(f, "BOP_MINUS")?,
+ BOP_MULT => write!(f, "BOP_MULT")?,
+ BOP_DIV => write!(f, "BOP_DIV")?,
+ BOP_MOD => write!(f, "BOP_MOD")?,
+ BOP_EQ => write!(f, "BOP_EQ")?,
+ BOP_EQQ => write!(f, "BOP_EQQ")?,
+ BOP_LT => write!(f, "BOP_LT")?,
+ BOP_LE => write!(f, "BOP_LE")?,
+ BOP_LTLT => write!(f, "BOP_LTLT")?,
+ BOP_AREF => write!(f, "BOP_AREF")?,
+ BOP_ASET => write!(f, "BOP_ASET")?,
+ BOP_LENGTH => write!(f, "BOP_LENGTH")?,
+ BOP_SIZE => write!(f, "BOP_SIZE")?,
+ BOP_EMPTY_P => write!(f, "BOP_EMPTY_P")?,
+ BOP_NIL_P => write!(f, "BOP_NIL_P")?,
+ BOP_SUCC => write!(f, "BOP_SUCC")?,
+ BOP_GT => write!(f, "BOP_GT")?,
+ BOP_GE => write!(f, "BOP_GE")?,
+ BOP_NOT => write!(f, "BOP_NOT")?,
+ BOP_NEQ => write!(f, "BOP_NEQ")?,
+ BOP_MATCH => write!(f, "BOP_MATCH")?,
+ BOP_FREEZE => write!(f, "BOP_FREEZE")?,
+ BOP_UMINUS => write!(f, "BOP_UMINUS")?,
+ BOP_MAX => write!(f, "BOP_MAX")?,
+ BOP_MIN => write!(f, "BOP_MIN")?,
+ BOP_HASH => write!(f, "BOP_HASH")?,
+ BOP_CALL => write!(f, "BOP_CALL")?,
+ BOP_AND => write!(f, "BOP_AND")?,
+ BOP_OR => write!(f, "BOP_OR")?,
+ BOP_CMP => write!(f, "BOP_CMP")?,
+ BOP_DEFAULT => write!(f, "BOP_DEFAULT")?,
+ BOP_PACK => write!(f, "BOP_PACK")?,
+ BOP_INCLUDE_P => write!(f, "BOP_INCLUDE_P")?,
_ => write!(f, "{bop}")?,
}
write!(f, ")")
diff --git a/zjit/src/hir/tests.rs b/zjit/src/hir/tests.rs
index 1e058ce11a..d0fc582548 100644
--- a/zjit/src/hir/tests.rs
+++ b/zjit/src/hir/tests.rs
@@ -2123,7 +2123,7 @@ pub mod hir_build_tests {
Jump bb2(v8, v9, v10, v11, v12)
bb2(v14:BasicObject, v15:BasicObject, v16:BasicObject, v17:NilClass, v18:NilClass):
v25:BasicObject = SendWithoutBlock v15, :+, v16
- PatchPoint BOPRedefined(ARRAY_REDEFINED_OP_FLAG, 33)
+ PatchPoint BOPRedefined(ARRAY_REDEFINED_OP_FLAG, BOP_INCLUDE_P)
v33:BoolExact = ArrayInclude v15, v16 | v16
PatchPoint NoEPEscape(test)
v40:ArrayExact[VALUE(0x1000)] = Const Value(VALUE(0x1000))
@@ -2154,7 +2154,7 @@ pub mod hir_build_tests {
EntryPoint JIT(0)
Jump bb2(v5, v6)
bb2(v8:BasicObject, v9:BasicObject):
- PatchPoint BOPRedefined(ARRAY_REDEFINED_OP_FLAG, 33)
+ PatchPoint BOPRedefined(ARRAY_REDEFINED_OP_FLAG, BOP_INCLUDE_P)
v15:BoolExact = DupArrayInclude VALUE(0x1000) | v9
CheckInterrupts
Return v15
@@ -2186,7 +2186,7 @@ pub mod hir_build_tests {
EntryPoint JIT(0)
Jump bb2(v5, v6)
bb2(v8:BasicObject, v9:BasicObject):
- SideExit PatchPoint(BOPRedefined(ARRAY_REDEFINED_OP_FLAG, 33))
+ SideExit PatchPoint(BOPRedefined(ARRAY_REDEFINED_OP_FLAG, BOP_INCLUDE_P))
");
}