summaryrefslogtreecommitdiffstats
path: root/Python/specialize.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2023-11-06 13:55:04 (GMT)
committerGitHub <noreply@github.com>2023-11-06 13:55:04 (GMT)
commita7b0f63cdb83c0652fab19bbbc8547dfe309b1d2 (patch)
tree28eec2b50f08af4b3eb6649a291a4d90a111dc3b /Python/specialize.c
parentd78c872e0d680f6e63afa6661df5021775a03690 (diff)
downloadcpython-a7b0f63cdb83c0652fab19bbbc8547dfe309b1d2.zip
cpython-a7b0f63cdb83c0652fab19bbbc8547dfe309b1d2.tar.gz
cpython-a7b0f63cdb83c0652fab19bbbc8547dfe309b1d2.tar.bz2
GH-111772: Specialize slot loads and stores for `_Py_T_OBJECT` (GH-111773)
Diffstat (limited to 'Python/specialize.c')
-rw-r--r--Python/specialize.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Python/specialize.c b/Python/specialize.c
index 41e74c6..ba704cb 100644
--- a/Python/specialize.c
+++ b/Python/specialize.c
@@ -742,7 +742,7 @@ analyze_descriptor(PyTypeObject *type, PyObject *name, PyObject **descr, int sto
if (desc_cls == &PyMemberDescr_Type) {
PyMemberDescrObject *member = (PyMemberDescrObject *)descriptor;
struct PyMemberDef *dmem = member->d_member;
- if (dmem->type == Py_T_OBJECT_EX) {
+ if (dmem->type == Py_T_OBJECT_EX || dmem->type == _Py_T_OBJECT) {
return OBJECT_SLOT;
}
return OTHER_SLOT;
@@ -942,7 +942,7 @@ _Py_Specialize_LoadAttr(PyObject *owner, _Py_CODEUNIT *instr, PyObject *name)
SPECIALIZATION_FAIL(LOAD_ATTR, SPEC_FAIL_OUT_OF_RANGE);
goto fail;
}
- assert(dmem->type == Py_T_OBJECT_EX);
+ assert(dmem->type == Py_T_OBJECT_EX || dmem->type == _Py_T_OBJECT);
assert(offset > 0);
cache->index = (uint16_t)offset;
write_u32(cache->version, type->tp_version_tag);
@@ -1082,7 +1082,7 @@ _Py_Specialize_StoreAttr(PyObject *owner, _Py_CODEUNIT *instr, PyObject *name)
SPECIALIZATION_FAIL(STORE_ATTR, SPEC_FAIL_OUT_OF_RANGE);
goto fail;
}
- assert(dmem->type == Py_T_OBJECT_EX);
+ assert(dmem->type == Py_T_OBJECT_EX || dmem->type == _Py_T_OBJECT);
assert(offset > 0);
cache->index = (uint16_t)offset;
write_u32(cache->version, type->tp_version_tag);