diff options
author | mpage <mpage@meta.com> | 2025-04-01 10:18:42 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-01 10:18:42 -0700 |
commit | 053c285f6b41f92fbdd1d4ff0c959cceefacd7cd (patch) | |
tree | c30af215989dca6fdd8f8ebb74396f29abdca308 /Lib/test/test_importlib/test_abc.py | |
parent | e9556e100452ed5a92fcf0e333ab75b0da29cf5b (diff) | |
download | cpython-053c285f6b41f92fbdd1d4ff0c959cceefacd7cd.tar.gz cpython-053c285f6b41f92fbdd1d4ff0c959cceefacd7cd.zip |
gh-130704: Strength reduce `LOAD_FAST{_LOAD_FAST}` (#130708)
Optimize `LOAD_FAST` opcodes into faster versions that load borrowed references onto the operand stack when we can prove that the lifetime of the local outlives the lifetime of the temporary that is loaded onto the stack.
Diffstat (limited to 'Lib/test/test_importlib/test_abc.py')
-rw-r--r-- | Lib/test/test_importlib/test_abc.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_importlib/test_abc.py b/Lib/test/test_importlib/test_abc.py index b1ab52f966f..070920d0da7 100644 --- a/Lib/test/test_importlib/test_abc.py +++ b/Lib/test/test_importlib/test_abc.py @@ -801,6 +801,9 @@ class SourceLoaderBytecodeTests(SourceLoaderTestHarness): data.extend(self.init._pack_uint32(0)) data.extend(self.init._pack_uint32(self.loader.source_mtime)) data.extend(self.init._pack_uint32(self.loader.source_size)) + # Make sure there's > 1 reference to code_object so that the + # marshaled representation below matches the cached representation + l = [code_object] data.extend(marshal.dumps(code_object)) self.assertEqual(self.loader.written[self.cached], bytes(data)) |