mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-44525: Copy free variables in bytecode to allow calls to inner functions to be specialized (GH-29595)
* Make internal APIs that take PyFrameConstructor take a PyFunctionObject instead. * Add reference to function to frame, borrow references to builtins and globals. * Add COPY_FREE_VARS instruction to allow specialization of calls to inner functions.
This commit is contained in:
parent
d82f2caf94
commit
135cabd328
25 changed files with 268 additions and 156 deletions
|
@ -370,6 +370,7 @@ _code_type = type(_write_atomic.__code__)
|
|||
# active exception)
|
||||
# Python 3.11a3 3464 (bpo-45636: Merge numeric BINARY_*/INPLACE_* into
|
||||
# BINARY_OP)
|
||||
# Python 3.11a3 3465 (Add COPY_FREE_VARS opcode)
|
||||
|
||||
#
|
||||
# MAGIC must change whenever the bytecode emitted by the compiler may no
|
||||
|
@ -379,7 +380,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 = (3464).to_bytes(2, 'little') + b'\r\n'
|
||||
MAGIC_NUMBER = (3465).to_bytes(2, 'little') + b'\r\n'
|
||||
_RAW_MAGIC_NUMBER = int.from_bytes(MAGIC_NUMBER, 'little') # For import.c
|
||||
|
||||
_PYCACHE = '__pycache__'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue