diff options
author | Mark Shannon <mark@hotpy.org> | 2021-06-04 01:03:54 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-03 18:03:54 -0600 |
commit | b2bf2bc1ece673d387341e06c8d3c2bc6e259747 (patch) | |
tree | 29217a2927ed27e71e6324876f279946219a25a9 /Lib/importlib | |
parent | 35002aa8f62dda1f79035e9904abdf476683e9be (diff) | |
download | cpython-b2bf2bc1ece673d387341e06c8d3c2bc6e259747.tar.gz cpython-b2bf2bc1ece673d387341e06c8d3c2bc6e259747.zip |
bpo-43693: Compute deref offsets in compiler (gh-25152)
Merges locals and cells into a single array.
Saves a pointer in the interpreter and means that we don't need the LOAD_CLOSURE opcode any more
https://bugs.python.org/issue43693
Diffstat (limited to 'Lib/importlib')
-rw-r--r-- | Lib/importlib/_bootstrap_external.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py index b2d8a70996b..39552186c87 100644 --- a/Lib/importlib/_bootstrap_external.py +++ b/Lib/importlib/_bootstrap_external.py @@ -356,6 +356,7 @@ _code_type = type(_write_atomic.__code__) # Python 3.11a1 3451 (Add CALL_METHOD_KW) # Python 3.11a1 3452 (drop nlocals from marshaled code objects) # Python 3.11a1 3453 (add co_fastlocalnames and co_fastlocalkinds) +# Python 3.11a1 3454 (compute cell offsets relative to locals bpo-43693) # # MAGIC must change whenever the bytecode emitted by the compiler may no @@ -365,7 +366,7 @@ _code_type = type(_write_atomic.__code__) # Whenever MAGIC_NUMBER is changed, the ranges in the magic_values array # in PC/launcher.c must also be updated. -MAGIC_NUMBER = (3453).to_bytes(2, 'little') + b'\r\n' +MAGIC_NUMBER = (3454).to_bytes(2, 'little') + b'\r\n' _RAW_MAGIC_NUMBER = int.from_bytes(MAGIC_NUMBER, 'little') # For import.c _PYCACHE = '__pycache__' |