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.
This commit is contained in:
mpage 2024-12-13 10:17:16 -08:00 committed by GitHub
parent 292067fbc9
commit 2de048ce79
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 435 additions and 177 deletions

View file

@ -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: