mirror of
https://github.com/python/cpython.git
synced 2025-10-21 22:22:48 +00:00
gh-103951: enable optimization for fast attribute access on module subclasses (GH-126264)
Co-authored-by: Nicolas Tessore <n.tessore@ucl.ac.uk>
This commit is contained in:
parent
3fecbe9255
commit
d9e251223e
5 changed files with 6 additions and 4 deletions
2
Python/generated_cases.c.h
generated
2
Python/generated_cases.c.h
generated
|
@ -5561,7 +5561,7 @@
|
|||
owner = stack_pointer[-1];
|
||||
uint32_t dict_version = read_u32(&this_instr[2].cache);
|
||||
PyObject *owner_o = PyStackRef_AsPyObjectBorrow(owner);
|
||||
DEOPT_IF(!PyModule_CheckExact(owner_o), LOAD_ATTR);
|
||||
DEOPT_IF(Py_TYPE(owner_o)->tp_getattro != PyModule_Type.tp_getattro, LOAD_ATTR);
|
||||
PyDictObject *dict = (PyDictObject *)((PyModuleObject *)owner_o)->md_dict;
|
||||
assert(dict != NULL);
|
||||
DEOPT_IF(dict->ma_keys->dk_version != dict_version, LOAD_ATTR);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue