aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Tools/cases_generator/stack.py
diff options
context:
space:
mode:
authormpage <mpage@meta.com>2024-12-13 10:17:16 -0800
committerGitHub <noreply@github.com>2024-12-13 10:17:16 -0800
commit2de048ce79e621f5ae0574095b9600fe8595f607 (patch)
treede3116284fc2016192787297de7a67ba348e5825 /Tools/cases_generator/stack.py
parent292067fbc9db81896c16ff12d51c21d2b0f233e2 (diff)
downloadcpython-2de048ce79e621f5ae0574095b9600fe8595f607.tar.gz
cpython-2de048ce79e621f5ae0574095b9600fe8595f607.zip
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.
Diffstat (limited to 'Tools/cases_generator/stack.py')
-rw-r--r--Tools/cases_generator/stack.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Tools/cases_generator/stack.py b/Tools/cases_generator/stack.py
index 286f47d0cfb..9471fe0e56f 100644
--- a/Tools/cases_generator/stack.py
+++ b/Tools/cases_generator/stack.py
@@ -512,6 +512,10 @@ class Storage:
self._push_defined_outputs()
self.stack.flush(out, cast_type, extract_bits)
+ def pop_dead_inputs(self, out: CWriter, cast_type: str = "uintptr_t", extract_bits: bool = True) -> None:
+ self.clear_dead_inputs()
+ self.stack.flush(out, cast_type, extract_bits)
+
def save(self, out: CWriter) -> None:
assert self.spilled >= 0
if self.spilled == 0: