Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Refine stats for LOAD_ATTR with class attribute.
  • Loading branch information
markshannon committed Dec 16, 2022
commit 05a9952dfe7f89f862924f50f88541002a2b40ad
10 changes: 8 additions & 2 deletions Python/specialize.c
Original file line number Diff line number Diff line change
Expand Up @@ -822,10 +822,16 @@ _Py_Specialize_LoadAttr(PyObject *owner, _Py_CODEUNIT *instr, PyObject *name)
SPECIALIZATION_FAIL(LOAD_ATTR, SPEC_FAIL_ATTR_CLASS_METHOD_OBJ);
goto fail;
case NON_OVERRIDING:
SPECIALIZATION_FAIL(LOAD_ATTR, SPEC_FAIL_ATTR_CLASS_ATTR_DESCRIPTOR);
SPECIALIZATION_FAIL(LOAD_ATTR,
(type->tp_flags & Py_TPFLAGS_MANAGED_DICT) ?
SPEC_FAIL_ATTR_CLASS_ATTR_DESCRIPTOR :
SPEC_FAIL_ATTR_NOT_MANAGED_DICT);
goto fail;
case NON_DESCRIPTOR:
SPECIALIZATION_FAIL(LOAD_ATTR, SPEC_FAIL_ATTR_CLASS_ATTR_SIMPLE);
SPECIALIZATION_FAIL(LOAD_ATTR,
(type->tp_flags & Py_TPFLAGS_MANAGED_DICT) ?
SPEC_FAIL_ATTR_CLASS_ATTR_SIMPLE :
SPEC_FAIL_ATTR_NOT_MANAGED_DICT);
goto fail;
case ABSENT:
if (specialize_dict_access(owner, instr, type, kind, name, LOAD_ATTR,
Expand Down