bpo-46528: Simplify the VM's stack manipulations (GH-30902)

This commit is contained in:
Brandt Bucher 2022-01-26 12:47:45 -08:00 committed by GitHub
parent d4a85f104b
commit 8548366864
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 288 additions and 323 deletions

View file

@ -382,6 +382,8 @@ _code_type = type(_write_atomic.__code__)
# Python 3.11a4 3474 (Add RESUME opcode)
# Python 3.11a5 3475 (Add RETURN_GENERATOR opcode)
# Python 3.11a5 3476 (Add ASYNC_GEN_WRAP opcode)
# Python 3.11a5 3477 (Replace DUP_TOP/DUP_TOP_TWO with COPY and
# ROT_TWO/ROT_THREE/ROT_FOUR/ROT_N with SWAP)
# Python 3.12 will start with magic number 3500
@ -395,7 +397,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 = (3476).to_bytes(2, 'little') + b'\r\n'
MAGIC_NUMBER = (3477).to_bytes(2, 'little') + b'\r\n'
_RAW_MAGIC_NUMBER = int.from_bytes(MAGIC_NUMBER, 'little') # For import.c
_PYCACHE = '__pycache__'