Skip to content

Commit 7d2f9ab

Browse files
nirvdrumtekknolagi
authored andcommitted
ZJIT: Handle display formatting for all defined bops
1 parent b06dd64 commit 7d2f9ab

File tree

2 files changed

+37
-19
lines changed

2 files changed

+37
-19
lines changed

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
@@ -2123,7 +2123,7 @@ pub mod hir_build_tests {
21232123
Jump bb2(v8, v9, v10, v11, v12)
21242124
bb2(v14:BasicObject, v15:BasicObject, v16:BasicObject, v17:NilClass, v18:NilClass):
21252125
v25:BasicObject = SendWithoutBlock v15, :+, v16
2126-
PatchPoint BOPRedefined(ARRAY_REDEFINED_OP_FLAG, 33)
2126+
PatchPoint BOPRedefined(ARRAY_REDEFINED_OP_FLAG, BOP_INCLUDE_P)
21272127
v33:BoolExact = ArrayInclude v15, v16 | v16
21282128
PatchPoint NoEPEscape(test)
21292129
v40:ArrayExact[VALUE(0x1000)] = Const Value(VALUE(0x1000))
@@ -2154,7 +2154,7 @@ pub mod hir_build_tests {
21542154
EntryPoint JIT(0)
21552155
Jump bb2(v5, v6)
21562156
bb2(v8:BasicObject, v9:BasicObject):
2157-
PatchPoint BOPRedefined(ARRAY_REDEFINED_OP_FLAG, 33)
2157+
PatchPoint BOPRedefined(ARRAY_REDEFINED_OP_FLAG, BOP_INCLUDE_P)
21582158
v15:BoolExact = DupArrayInclude VALUE(0x1000) | v9
21592159
CheckInterrupts
21602160
Return v15
@@ -2186,7 +2186,7 @@ pub mod hir_build_tests {
21862186
EntryPoint JIT(0)
21872187
Jump bb2(v5, v6)
21882188
bb2(v8:BasicObject, v9:BasicObject):
2189-
SideExit PatchPoint(BOPRedefined(ARRAY_REDEFINED_OP_FLAG, 33))
2189+
SideExit PatchPoint(BOPRedefined(ARRAY_REDEFINED_OP_FLAG, BOP_INCLUDE_P))
21902190
");
21912191
}
21922192

0 commit comments

Comments
 (0)