Skip to content

Commit 0a2cd4d

Browse files
author
aleksandr.tseluyko
committed
gh-145858: Remove DELETE_DEREF bytecode instruction
Replace DELETE_DEREF with the sequence LOAD_DEREF + POP_TOP + PUSH_NULL + STORE_DEREF in the compiler. Adapt STORE_DEREF to handle NULL stackref for cell clearing.
1 parent a0c57a8 commit 0a2cd4d

File tree

16 files changed

+908
-1025
lines changed

16 files changed

+908
-1025
lines changed

Doc/library/dis.rst

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1547,17 +1547,6 @@ iterations of the loop.
15471547
``i`` is no longer offset by the length of :attr:`~codeobject.co_varnames`.
15481548

15491549

1550-
.. opcode:: DELETE_DEREF (i)
1551-
1552-
Empties the cell contained in slot ``i`` of the "fast locals" storage.
1553-
Used by the :keyword:`del` statement.
1554-
1555-
.. versionadded:: 3.2
1556-
1557-
.. versionchanged:: 3.11
1558-
``i`` is no longer offset by the length of :attr:`~codeobject.co_varnames`.
1559-
1560-
15611550
.. opcode:: COPY_FREE_VARS (n)
15621551

15631552
Copies the ``n`` :term:`free (closure) variables <closure variable>` from the closure

Include/internal/pycore_magic_number.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ Known values:
294294
Python 3.15a4 3661 (Lazy imports IMPORT_NAME opcode changes)
295295
Python 3.15a8 3662 (Add counter to RESUME)
296296
Python 3.15a8 3663 (Merge GET_ITER and GET_YIELD_FROM_ITER. Modify SEND to make it a bit more like FOR_ITER)
297+
Python 3.15a8 3664 (Remove DELETE_DEREF opcode)
297298
298299
299300
Python 3.16 will start with 3700
@@ -307,7 +308,7 @@ PC/launcher.c must also be updated.
307308
308309
*/
309310

310-
#define PYC_MAGIC_NUMBER 3663
311+
#define PYC_MAGIC_NUMBER 3664
311312
/* This is equivalent to converting PYC_MAGIC_NUMBER to 2 bytes
312313
(little-endian) and then appending b'\r\n'. */
313314
#define PYC_MAGIC_NUMBER_TOKEN \

Include/internal/pycore_opcode_metadata.h

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

0 commit comments

Comments
 (0)