GH-112354: END_FOR instruction to only pop one value. (GH-114247)

* Compiler emits END_FOR; POP_TOP instead of END_FOR. To support tier 2 side exits in loops.
This commit is contained in:
Mark Shannon 2024-01-24 15:10:17 +00:00 committed by GitHub
parent 6fadd68da5
commit 981d172f7f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 238 additions and 184 deletions

View file

@ -464,6 +464,7 @@ _code_type = type(_write_atomic.__code__)
# Python 3.13a1 3565 (Oparg of YIELD_VALUE indicates whether it is in a yield-from)
# Python 3.13a1 3566 (Emit JUMP_NO_INTERRUPT instead of JUMP for non-loop no-lineno cases)
# Python 3.13a1 3567 (Reimplement line number propagation by the compiler)
# Python 3.13a1 3568 (Change semantics of END_FOR)
# Python 3.14 will start with 3600
@ -480,7 +481,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 = (3567).to_bytes(2, 'little') + b'\r\n'
MAGIC_NUMBER = (3568).to_bytes(2, 'little') + b'\r\n'
_RAW_MAGIC_NUMBER = int.from_bytes(MAGIC_NUMBER, 'little') # For import.c