]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-115999: Specialize loading attributes from modules in free-threaded builds (#127711)
authormpage <mpage@meta.com>
Fri, 13 Dec 2024 18:17:16 +0000 (10:17 -0800)
committerGitHub <noreply@github.com>
Fri, 13 Dec 2024 18:17:16 +0000 (10:17 -0800)
commit2de048ce79e621f5ae0574095b9600fe8595f607
treede3116284fc2016192787297de7a67ba348e5825
parent292067fbc9db81896c16ff12d51c21d2b0f233e2
gh-115999: Specialize loading attributes from modules in free-threaded builds (#127711)

We use the same approach that was used for specialization of LOAD_GLOBAL in free-threaded builds:

_CHECK_ATTR_MODULE is renamed to _CHECK_ATTR_MODULE_PUSH_KEYS; it pushes the keys object for the following _LOAD_ATTR_MODULE_FROM_KEYS (nee _LOAD_ATTR_MODULE). This arrangement avoids having to recheck the keys version.

_LOAD_ATTR_MODULE is renamed to _LOAD_ATTR_MODULE_FROM_KEYS; it loads the value from the keys object pushed by the preceding _CHECK_ATTR_MODULE_PUSH_KEYS at the cached index.
15 files changed:
Include/internal/pycore_opcode_metadata.h
Include/internal/pycore_uop_ids.h
Include/internal/pycore_uop_metadata.h
Lib/test/test_capi/test_misc.py
Lib/test/test_generated_cases.py
Lib/test/test_opcache.py
Python/bytecodes.c
Python/executor_cases.c.h
Python/generated_cases.c.h
Python/optimizer_analysis.c
Python/optimizer_bytecodes.c
Python/optimizer_cases.c.h
Python/specialize.c
Tools/cases_generator/generators_common.py
Tools/cases_generator/stack.py