mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
bpo-46329: Split calls into precall and call instructions. (GH-30855)
* Add PRECALL_FUNCTION opcode. * Move 'call shape' varaibles into struct. * Replace CALL_NO_KW and CALL_KW with KW_NAMES and CALL instructions. * Specialize for builtin methods taking using the METH_FASTCALL | METH_KEYWORDS protocol. * Allow kwnames for specialized calls to builtin types. * Specialize calls to tuple(arg) and str(arg).
This commit is contained in:
parent
5a9e423473
commit
89fd7c3452
16 changed files with 957 additions and 674 deletions
|
@ -384,9 +384,14 @@ _code_type = type(_write_atomic.__code__)
|
|||
# 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.11a5 3478 (New CALL opcodes)
|
||||
|
||||
# Python 3.12 will start with magic number 3500
|
||||
|
||||
|
||||
# Python 3.12 will start with magic number 3500
|
||||
|
||||
|
||||
#
|
||||
# MAGIC must change whenever the bytecode emitted by the compiler may no
|
||||
# longer be understood by older implementations of the eval loop (usually
|
||||
|
@ -397,7 +402,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 = (3477).to_bytes(2, 'little') + b'\r\n'
|
||||
MAGIC_NUMBER = (3478).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