GH-115651: Convert LOAD_MODULE_ATTR into LOAD_INLINE_CONST when the module is itself a constant. (GH-115711)

This commit is contained in:
Mark Shannon 2024-02-22 14:48:25 +00:00 committed by GitHub
parent c6a47de709
commit b348313e7a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 182 additions and 95 deletions

View file

@ -1932,11 +1932,11 @@ dummy_func(
_LOAD_ATTR_INSTANCE_VALUE +
unused/5; // Skip over rest of cache
op(_CHECK_ATTR_MODULE, (type_version/2, owner -- owner)) {
op(_CHECK_ATTR_MODULE, (dict_version/2, owner -- owner)) {
DEOPT_IF(!PyModule_CheckExact(owner));
PyDictObject *dict = (PyDictObject *)((PyModuleObject *)owner)->md_dict;
assert(dict != NULL);
DEOPT_IF(dict->ma_keys->dk_version != type_version);
DEOPT_IF(dict->ma_keys->dk_version != dict_version);
}
op(_LOAD_ATTR_MODULE, (index/1, owner -- attr, null if (oparg & 1))) {