Skip to content

Commit 61d4e9a

Browse files
committed
ZJIT: Handle display formatting for all defined bops
1 parent 796d59c commit 61d4e9a

2 files changed

Lines changed: 37 additions & 19 deletions

File tree

zjit/src/hir.rs

Lines changed: 34 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -217,22 +217,40 @@ impl<'a> std::fmt::Display for InvariantPrinter<'a> {
217217
}
218218
write!(f, ", ")?;
219219
match bop {
220-
BOP_PLUS => write!(f, "BOP_PLUS")?,
221-
BOP_MINUS => write!(f, "BOP_MINUS")?,
222-
BOP_MULT => write!(f, "BOP_MULT")?,
223-
BOP_DIV => write!(f, "BOP_DIV")?,
224-
BOP_MOD => write!(f, "BOP_MOD")?,
225-
BOP_EQ => write!(f, "BOP_EQ")?,
226-
BOP_NEQ => write!(f, "BOP_NEQ")?,
227-
BOP_LT => write!(f, "BOP_LT")?,
228-
BOP_LE => write!(f, "BOP_LE")?,
229-
BOP_GT => write!(f, "BOP_GT")?,
230-
BOP_GE => write!(f, "BOP_GE")?,
231-
BOP_FREEZE => write!(f, "BOP_FREEZE")?,
232-
BOP_UMINUS => write!(f, "BOP_UMINUS")?,
233-
BOP_MAX => write!(f, "BOP_MAX")?,
234-
BOP_HASH => write!(f, "BOP_HASH")?,
235-
BOP_AREF => write!(f, "BOP_AREF")?,
220+
BOP_PLUS => write!(f, "BOP_PLUS")?,
221+
BOP_MINUS => write!(f, "BOP_MINUS")?,
222+
BOP_MULT => write!(f, "BOP_MULT")?,
223+
BOP_DIV => write!(f, "BOP_DIV")?,
224+
BOP_MOD => write!(f, "BOP_MOD")?,
225+
BOP_EQ => write!(f, "BOP_EQ")?,
226+
BOP_EQQ => write!(f, "BOP_EQQ")?,
227+
BOP_LT => write!(f, "BOP_LT")?,
228+
BOP_LE => write!(f, "BOP_LE")?,
229+
BOP_LTLT => write!(f, "BOP_LTLT")?,
230+
BOP_AREF => write!(f, "BOP_AREF")?,
231+
BOP_ASET => write!(f, "BOP_ASET")?,
232+
BOP_LENGTH => write!(f, "BOP_LENGTH")?,
233+
BOP_SIZE => write!(f, "BOP_SIZE")?,
234+
BOP_EMPTY_P => write!(f, "BOP_EMPTY_P")?,
235+
BOP_NIL_P => write!(f, "BOP_NIL_P")?,
236+
BOP_SUCC => write!(f, "BOP_SUCC")?,
237+
BOP_GT => write!(f, "BOP_GT")?,
238+
BOP_GE => write!(f, "BOP_GE")?,
239+
BOP_NOT => write!(f, "BOP_NOT")?,
240+
BOP_NEQ => write!(f, "BOP_NEQ")?,
241+
BOP_MATCH => write!(f, "BOP_MATCH")?,
242+
BOP_FREEZE => write!(f, "BOP_FREEZE")?,
243+
BOP_UMINUS => write!(f, "BOP_UMINUS")?,
244+
BOP_MAX => write!(f, "BOP_MAX")?,
245+
BOP_MIN => write!(f, "BOP_MIN")?,
246+
BOP_HASH => write!(f, "BOP_HASH")?,
247+
BOP_CALL => write!(f, "BOP_CALL")?,
248+
BOP_AND => write!(f, "BOP_AND")?,
249+
BOP_OR => write!(f, "BOP_OR")?,
250+
BOP_CMP => write!(f, "BOP_CMP")?,
251+
BOP_DEFAULT => write!(f, "BOP_DEFAULT")?,
252+
BOP_PACK => write!(f, "BOP_PACK")?,
253+
BOP_INCLUDE_P => write!(f, "BOP_INCLUDE_P")?,
236254
_ => write!(f, "{bop}")?,
237255
}
238256
write!(f, ")")

zjit/src/hir/tests.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2089,7 +2089,7 @@ pub mod hir_build_tests {
20892089
Jump bb2(v8, v9, v10, v11, v12)
20902090
bb2(v14:BasicObject, v15:BasicObject, v16:BasicObject, v17:NilClass, v18:NilClass):
20912091
v25:BasicObject = SendWithoutBlock v15, :+, v16
2092-
PatchPoint BOPRedefined(ARRAY_REDEFINED_OP_FLAG, 33)
2092+
PatchPoint BOPRedefined(ARRAY_REDEFINED_OP_FLAG, BOP_INCLUDE_P)
20932093
v33:BoolExact = ArrayInclude v15, v16 | v16
20942094
PatchPoint NoEPEscape(test)
20952095
v40:ArrayExact[VALUE(0x1000)] = Const Value(VALUE(0x1000))
@@ -2120,7 +2120,7 @@ pub mod hir_build_tests {
21202120
EntryPoint JIT(0)
21212121
Jump bb2(v5, v6)
21222122
bb2(v8:BasicObject, v9:BasicObject):
2123-
PatchPoint BOPRedefined(ARRAY_REDEFINED_OP_FLAG, 33)
2123+
PatchPoint BOPRedefined(ARRAY_REDEFINED_OP_FLAG, BOP_INCLUDE_P)
21242124
v15:BoolExact = DupArrayInclude VALUE(0x1000) | v9
21252125
CheckInterrupts
21262126
Return v15
@@ -2152,7 +2152,7 @@ pub mod hir_build_tests {
21522152
EntryPoint JIT(0)
21532153
Jump bb2(v5, v6)
21542154
bb2(v8:BasicObject, v9:BasicObject):
2155-
SideExit PatchPoint(BOPRedefined(ARRAY_REDEFINED_OP_FLAG, 33))
2155+
SideExit PatchPoint(BOPRedefined(ARRAY_REDEFINED_OP_FLAG, BOP_INCLUDE_P))
21562156
");
21572157
}
21582158

0 commit comments

Comments
 (0)