diff options
author | Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> | 2021-05-15 15:15:23 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-15 15:15:23 (GMT) |
commit | f24afda5917ce1710ad08ca34b2509f1f2b16de2 (patch) | |
tree | 72513ebad5e8235d451cffdb27f67182606b686f /Lib | |
parent | e4e931a67e49cf3c61263dc94fb0806c34f972cd (diff) | |
download | cpython-f24afda5917ce1710ad08ca34b2509f1f2b16de2.zip cpython-f24afda5917ce1710ad08ca34b2509f1f2b16de2.tar.gz cpython-f24afda5917ce1710ad08ca34b2509f1f2b16de2.tar.bz2 |
bpo-26110: Add ``CALL_METHOD_KW`` opcode to speedup method calls with keywords (GH-26014)
* Add CALL_METHOD_KW
* Make CALL_METHOD branchless too since it shares the same code
* Place parentheses in STACK_SHRINK
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/importlib/_bootstrap_external.py | 3 | ||||
-rw-r--r-- | Lib/opcode.py | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py index 469610a..8d0ebef 100644 --- a/Lib/importlib/_bootstrap_external.py +++ b/Lib/importlib/_bootstrap_external.py @@ -353,6 +353,7 @@ _code_type = type(_write_atomic.__code__) # Python 3.10b1 3438 Safer line number table handling. # Python 3.10b1 3439 (Add ROT_N) # Python 3.11a1 3450 Use exception table for unwinding ("zero cost" exception handling) +# Python 3.11a1 3451 (Add CALL_METHOD_KW) # # MAGIC must change whenever the bytecode emitted by the compiler may no @@ -362,7 +363,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 = (3450).to_bytes(2, 'little') + b'\r\n' +MAGIC_NUMBER = (3451).to_bytes(2, 'little') + b'\r\n' _RAW_MAGIC_NUMBER = int.from_bytes(MAGIC_NUMBER, 'little') # For import.c _PYCACHE = '__pycache__' diff --git a/Lib/opcode.py b/Lib/opcode.py index 88022a4..da143fe 100644 --- a/Lib/opcode.py +++ b/Lib/opcode.py @@ -213,5 +213,6 @@ def_op('LIST_EXTEND', 162) def_op('SET_UPDATE', 163) def_op('DICT_MERGE', 164) def_op('DICT_UPDATE', 165) +def_op('CALL_METHOD_KW', 166) del def_op, name_op, jrel_op, jabs_op |