mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
GH-115651: Convert LOAD_MODULE_ATTR
into LOAD_INLINE_CONST
when the module is itself a constant. (GH-115711)
This commit is contained in:
parent
c6a47de709
commit
b348313e7a
6 changed files with 182 additions and 95 deletions
4
Python/executor_cases.c.h
generated
4
Python/executor_cases.c.h
generated
|
@ -1856,11 +1856,11 @@
|
|||
case _CHECK_ATTR_MODULE: {
|
||||
PyObject *owner;
|
||||
owner = stack_pointer[-1];
|
||||
uint32_t type_version = (uint32_t)CURRENT_OPERAND();
|
||||
uint32_t dict_version = (uint32_t)CURRENT_OPERAND();
|
||||
if (!PyModule_CheckExact(owner)) goto deoptimize;
|
||||
PyDictObject *dict = (PyDictObject *)((PyModuleObject *)owner)->md_dict;
|
||||
assert(dict != NULL);
|
||||
if (dict->ma_keys->dk_version != type_version) goto deoptimize;
|
||||
if (dict->ma_keys->dk_version != dict_version) goto deoptimize;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue