Skip to content

Commit 34535ba

Browse files
committed
gh-148874: add flag to CALL to skip periodic check in with
1 parent 618b726 commit 34535ba

22 files changed

Lines changed: 2202 additions & 2145 deletions

Doc/library/dis.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ the following command can be used to display the disassembly of
7777
<BLANKLINE>
7878
3 LOAD_GLOBAL 1 (len + NULL)
7979
LOAD_FAST_BORROW 0 (alist)
80-
CALL 1
80+
CALL 2 (1)
8181
RETURN_VALUE
8282

8383
(The "2" is a line number).
@@ -1601,6 +1601,9 @@ iterations of the loop.
16011601
.. versionchanged:: 3.13
16021602
Calls with keyword arguments are now handled by :opcode:`CALL_KW`.
16031603

1604+
.. versionchanged:: next
1605+
``argc`` is now the oparg shifted right by one.
1606+
16041607

16051608
.. opcode:: CALL_KW (argc)
16061609

Include/internal/pycore_magic_number.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ Known values:
296296
Python 3.15a8 3663 (Merge GET_ITER and GET_YIELD_FROM_ITER. Modify SEND to make it a bit more like FOR_ITER)
297297
Python 3.15a8 3664 (Fix __qualname__ for __annotate__ functions)
298298
Python 3.15a8 3665 (Add FOR_ITER_VIRTUAL and GET_ITER specializations)
299+
Python 3.15a9 3666 (Pack CALL oparg as (argcount<<1) | skip_periodic; gh-148874)
299300
300301
301302
Python 3.16 will start with 3700
@@ -309,7 +310,7 @@ PC/launcher.c must also be updated.
309310
310311
*/
311312

312-
#define PYC_MAGIC_NUMBER 3665
313+
#define PYC_MAGIC_NUMBER 3666
313314
/* This is equivalent to converting PYC_MAGIC_NUMBER to 2 bytes
314315
(little-endian) and then appending b'\r\n'. */
315316
#define PYC_MAGIC_NUMBER_TOKEN \

Include/internal/pycore_opcode_metadata.h

Lines changed: 27 additions & 27 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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ extern "C" {
8787
#define RESUME_OPARG_LOCATION_MASK 0x7
8888
#define RESUME_OPARG_DEPTH1_MASK 0x8
8989

90+
#define CALL_OPARG_SKIP_PENDING_MASK 0x1
91+
#define CALL_ARGCOUNT(oparg) ((oparg) >> 1)
92+
#define CALL_OPARG(argcount, skip) (((argcount) << 1) | (skip))
93+
9094
#define GET_ITER_YIELD_FROM 1
9195
#define GET_ITER_YIELD_FROM_NO_CHECK 2
9296
#define GET_ITER_YIELD_FROM_CORO_CHECK 3

0 commit comments

Comments
 (0)