GH-125837: Split `LOAD_CONST` into three. (GH-125972) · python/cpython@faa3272 · GitHub
Skip to content

Commit faa3272

Browse files
authored
GH-125837: Split LOAD_CONST into three. (GH-125972)
* Add LOAD_CONST_IMMORTAL opcode * Add LOAD_SMALL_INT opcode * Remove RETURN_CONST opcode
1 parent 67f5c5b commit faa3272

33 files changed

Lines changed: 706 additions & 538 deletions

Doc/library/dis.rst

Lines changed: 16 additions & 7 deletions

Doc/whatsnew/3.12.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1123,7 +1123,7 @@ CPython bytecode changes
11231123
* Add the :opcode:`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer and
11241124
Vladimir Matveev in :gh:`103497`.)
11251125

1126-
* Add the :opcode:`RETURN_CONST` instruction. (Contributed by Wenyang Wang in :gh:`101632`.)
1126+
* Add the ``RETURN_CONST`` instruction. (Contributed by Wenyang Wang in :gh:`101632`.)
11271127

11281128
Demos and Tools
11291129
===============

Include/internal/pycore_magic_number.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ Known values:
261261
Python 3.14a1 3606 (Specialize CALL_KW)
262262
Python 3.14a1 3607 (Add pseudo instructions JUMP_IF_TRUE/FALSE)
263263
Python 3.14a1 3608 (Add support for slices)
264+
Python 3.14a2 3609 (Add LOAD_SMALL_INT and LOAD_CONST_IMMORTAL instructions, remove RETURN_CONST)
264265
265266
Python 3.15 will start with 3650
266267
@@ -273,7 +274,7 @@ PC/launcher.c must also be updated.
273274
274275
*/
275276

276-
#define PYC_MAGIC_NUMBER 3608
277+
#define PYC_MAGIC_NUMBER 3609
277278
/* This is equivalent to converting PYC_MAGIC_NUMBER to 2 bytes
278279
(little-endian) and then appending b'\r\n'. */
279280
#define PYC_MAGIC_NUMBER_TOKEN \

Include/internal/pycore_opcode_metadata.h

Lines changed: 17 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_opcode_utils.h

Lines changed: 0 additions & 1 deletion

0 commit comments

Comments
 (0)