summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorBrandt Bucher <brandtbucher@microsoft.com>2022-02-28 11:54:14 (GMT)
committerGitHub <noreply@github.com>2022-02-28 11:54:14 (GMT)
commit424ecab494d538650ba34937cdd710094ccb2275 (patch)
treefe50c89dca09df2c3f2ff49cc937af75a9450c75 /Lib
parentc32aef48533769161e1247927a5b418322e0860c (diff)
downloadcpython-424ecab494d538650ba34937cdd710094ccb2275.zip
cpython-424ecab494d538650ba34937cdd710094ccb2275.tar.gz
cpython-424ecab494d538650ba34937cdd710094ccb2275.tar.bz2
bpo-46841: Use inline caching for `UNPACK_SEQUENCE` (GH-31591)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/importlib/_bootstrap_external.py3
-rw-r--r--Lib/opcode.py2
2 files changed, 3 insertions, 2 deletions
diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py
index 53fe1b8..be23eee 100644
--- a/Lib/importlib/_bootstrap_external.py
+++ b/Lib/importlib/_bootstrap_external.py
@@ -388,6 +388,7 @@ _code_type = type(_write_atomic.__code__)
# Python 3.11a5 3479 (Add PUSH_NULL opcode)
# Python 3.11a5 3480 (New CALL opcodes, second iteration)
# Python 3.11a5 3481 (Use inline CACHE instructions)
+# Python 3.11a5 3482 (Use inline caching for UNPACK_SEQUENCE)
# Python 3.12 will start with magic number 3500
@@ -402,7 +403,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 = (3481).to_bytes(2, 'little') + b'\r\n'
+MAGIC_NUMBER = (3482).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 84ad002..8fa71bf 100644
--- a/Lib/opcode.py
+++ b/Lib/opcode.py
@@ -109,7 +109,7 @@ HAVE_ARGUMENT = 90 # Opcodes from here have an argument:
name_op('STORE_NAME', 90) # Index in name list
name_op('DELETE_NAME', 91) # ""
-def_op('UNPACK_SEQUENCE', 92) # Number of tuple items
+def_op('UNPACK_SEQUENCE', 92, 1) # Number of tuple items
jrel_op('FOR_ITER', 93)
def_op('UNPACK_EX', 94)
name_op('STORE_ATTR', 95) # Index in name list