gh-146393: Use recorded type instead of instance in BINARY_OP (#148569)

This commit is contained in:
Pieter Eendebak 2026-04-14 22:11:42 +02:00 committed by GitHub
parent 0012686d92
commit 5c3decad66
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 1042 additions and 1013 deletions

View file

@ -5725,7 +5725,7 @@ dummy_func(
DEAD(rhs);
}
macro(BINARY_OP) = _SPECIALIZE_BINARY_OP + _RECORD_TOS + _RECORD_NOS + unused/4 + _BINARY_OP + POP_TOP + POP_TOP;
macro(BINARY_OP) = _SPECIALIZE_BINARY_OP + _RECORD_TOS_TYPE + _RECORD_NOS_TYPE + unused/4 + _BINARY_OP + POP_TOP + POP_TOP;
pure replicate(2:4) inst(SWAP, (bottom, unused[oparg-2], top --
bottom, unused[oparg-2], top)) {
@ -6178,6 +6178,10 @@ dummy_func(
RECORD_VALUE(PyStackRef_AsPyObjectBorrow(nos));
}
tier2 op(_RECORD_NOS_TYPE, (nos, tos -- nos, tos)) {
RECORD_VALUE(Py_TYPE(PyStackRef_AsPyObjectBorrow(nos)));
}
tier2 op(_RECORD_NOS_GEN_FUNC, (nos, tos -- nos, tos)) {
PyObject *obj = PyStackRef_AsPyObjectBorrow(nos);
if (PyGen_Check(obj)) {