Skip to content

Commit bb70f1c

Browse files
authored
Merge branch 'main' into fix-issue-138774
2 parents 0fa0574 + 1b8dcda commit bb70f1c

File tree

5 files changed

+78
-19
lines changed

5 files changed

+78
-19
lines changed

Doc/library/dis.rst

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,11 +1102,6 @@ iterations of the loop.
11021102
Pushes ``co_consts[consti]`` onto the stack.
11031103

11041104

1105-
.. opcode:: LOAD_CONST_IMMORTAL (consti)
1106-
1107-
Works as :opcode:`LOAD_CONST`, but is more efficient for immortal objects.
1108-
1109-
11101105
.. opcode:: LOAD_SMALL_INT (i)
11111106

11121107
Pushes the integer ``i`` onto the stack.
@@ -1647,7 +1642,7 @@ iterations of the loop.
16471642

16481643
Pushes a ``NULL`` to the stack.
16491644
Used in the call sequence to match the ``NULL`` pushed by
1650-
:opcode:`LOAD_METHOD` for non-method calls.
1645+
:opcode:`!LOAD_METHOD` for non-method calls.
16511646

16521647
.. versionadded:: 3.11
16531648

@@ -1968,14 +1963,15 @@ but are replaced by real opcodes or removed before bytecode is generated.
19681963
Marks the end of the code block associated with the last ``SETUP_FINALLY``,
19691964
``SETUP_CLEANUP`` or ``SETUP_WITH``.
19701965

1966+
19711967
.. opcode:: JUMP
1972-
.. opcode:: JUMP_NO_INTERRUPT
1968+
JUMP_NO_INTERRUPT
19731969

19741970
Undirected relative jump instructions which are replaced by their
19751971
directed (forward/backward) counterparts by the assembler.
19761972

19771973
.. opcode:: JUMP_IF_TRUE
1978-
.. opcode:: JUMP_IF_FALSE
1974+
JUMP_IF_FALSE
19791975

19801976
Conditional jumps which do not impact the stack. Replaced by the sequence
19811977
``COPY 1``, ``TO_BOOL``, ``POP_JUMP_IF_TRUE/FALSE``.
@@ -1991,12 +1987,6 @@ but are replaced by real opcodes or removed before bytecode is generated.
19911987
This opcode is now a pseudo-instruction.
19921988

19931989

1994-
.. opcode:: LOAD_METHOD
1995-
1996-
Optimized unbound method lookup. Emitted as a ``LOAD_ATTR`` opcode
1997-
with a flag set in the arg.
1998-
1999-
20001990
.. _opcode_collections:
20011991

20021992
Opcode collections

Doc/whatsnew/3.14.rst

Lines changed: 71 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2802,9 +2802,79 @@ Deprecated
28022802
CPython bytecode changes
28032803
========================
28042804

2805-
* Replaced the opcode ``BINARY_SUBSCR`` by :opcode:`BINARY_OP` with oparg ``NB_SUBSCR``.
2805+
* Replaced the opcode :opcode:`!BINARY_SUBSCR` by the :opcode:`BINARY_OP`
2806+
opcode with the ``NB_SUBSCR`` oparg.
28062807
(Contributed by Irit Katriel in :gh:`100239`.)
28072808

2809+
* Add the :opcode:`BUILD_INTERPOLATION` and :opcode:`BUILD_TEMPLATE`
2810+
opcodes to construct new :class:`~string.templatelib.Interpolation`
2811+
and :class:`~string.templatelib.Template` instances, respectively.
2812+
(Contributed by Lysandros Nikolaou and others in :gh:`132661`;
2813+
see also :ref:`PEP 750: Template strings <whatsnew314-pep750>`).
2814+
2815+
* Remove the :opcode:`!BUILD_CONST_KEY_MAP` opcode.
2816+
Use :opcode:`BUILD_MAP` instead.
2817+
(Contributed by Mark Shannon in :gh:`122160`.)
2818+
2819+
* Replace the :opcode:`!LOAD_ASSERTION_ERROR` opcode with
2820+
:opcode:`LOAD_COMMON_CONSTANT` and add support for loading
2821+
:exc:`NotImplementedError`.
2822+
2823+
* Add the :opcode:`LOAD_FAST_BORROW` and :opcode:`LOAD_FAST_BORROW_LOAD_FAST_BORROW`
2824+
opcodes to reduce reference counting overhead when the interpreter can prove
2825+
that the reference in the frame outlives the reference loaded onto the stack.
2826+
(Contributed by Matt Page in :gh:`130704`.)
2827+
2828+
* Add the :opcode:`LOAD_SMALL_INT` opcode, which pushes a small integer
2829+
equal to the ``oparg`` to the stack.
2830+
The :opcode:`!RETURN_CONST` opcode is removed as it is no longer used.
2831+
(Contributed by Mark Shannon in :gh:`125837`.)
2832+
2833+
* Add the new :opcode:`LOAD_SPECIAL` instruction.
2834+
Generate code for :keyword:`with` and :keyword:`async with` statements
2835+
using the new instruction.
2836+
Removed the :opcode:`!BEFORE_WITH` and :opcode:`!BEFORE_ASYNC_WITH` instructions.
2837+
(Contributed by Mark Shannon in :gh:`120507`.)
2838+
2839+
* Add the :opcode:`POP_ITER` opcode to support 'virtual' iterators.
2840+
(Contributed by Mark Shannon in :gh:`132554`.)
2841+
2842+
Pseudo-instructions
2843+
-------------------
2844+
2845+
* Add the :opcode:`!ANNOTATIONS_PLACEHOLDER` pseudo instruction
2846+
to support partially executed module-level annotations with
2847+
:ref:`deferred evaluation of annotations <whatsnew314-pep649>`.
2848+
(Contributed by Jelle Zijlstra in :gh:`130907`.)
2849+
2850+
* Add the :opcode:`!BINARY_OP_EXTEND` pseudo instruction,
2851+
which executes a pair of functions (guard and specialization functions)
2852+
accessed from the inline cache.
2853+
(Contributed by Irit Katriel in :gh:`100239`.)
2854+
2855+
* Add three specializations for :opcode:`CALL_KW`;
2856+
:opcode:`!CALL_KW_PY` for calls to Python functions,
2857+
:opcode:`!CALL_KW_BOUND_METHOD` for calls to bound methods, and
2858+
:opcode:`!CALL_KW_NON_PY` for all other calls.
2859+
(Contributed by Mark Shannon in :gh:`118093`.)
2860+
2861+
* Add the :opcode:`JUMP_IF_TRUE` and :opcode:`JUMP_IF_FALSE` pseudo instructions,
2862+
conditional jumps which do not impact the stack.
2863+
Replaced by the sequence ``COPY 1``, ``TO_BOOL``, ``POP_JUMP_IF_TRUE/FALSE``.
2864+
(Contributed by Irit Katriel in :gh:`124285`.)
2865+
2866+
* Add the :opcode:`!LOAD_CONST_MORTAL` pseudo instruction.
2867+
(Contributed by Mark Shannon in :gh:`128685`.)
2868+
2869+
* Add the :opcode:`!LOAD_CONST_IMMORTAL` pseudo instruction,
2870+
which does the same as :opcode:`!LOAD_CONST`, but is more efficient
2871+
for immortal objects.
2872+
(Contributed by Mark Shannon in :gh:`125837`.)
2873+
2874+
* Add the :opcode:`NOT_TAKEN` pseudo instruction, used by :mod:`sys.monitoring`
2875+
to record branch events (such as :monitoring-event:`BRANCH_LEFT`).
2876+
(Contributed by Mark Shannon in :gh:`122548`.)
2877+
28082878

28092879
C API changes
28102880
=============

Doc/whatsnew/3.7.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2483,7 +2483,7 @@ avoiding possible problems use new functions :c:func:`PySlice_Unpack` and
24832483
CPython bytecode changes
24842484
------------------------
24852485

2486-
There are two new opcodes: :opcode:`LOAD_METHOD` and :opcode:`!CALL_METHOD`.
2486+
There are two new opcodes: :opcode:`!LOAD_METHOD` and :opcode:`!CALL_METHOD`.
24872487
(Contributed by Yury Selivanov and INADA Naoki in :issue:`26110`.)
24882488

24892489
The :opcode:`!STORE_ANNOTATION` opcode has been removed.

Lib/test/test_locale.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,7 @@ def setUp(self):
351351
enc = codecs.lookup(locale.getencoding() or 'ascii').name
352352
if enc not in ('utf-8', 'iso8859-1', 'cp1252'):
353353
raise unittest.SkipTest('encoding not suitable')
354-
if enc != 'iso8859-1' and (sys.platform == 'darwin' or is_android or
355-
sys.platform.startswith('freebsd')):
354+
if enc != 'iso8859-1' and is_android:
356355
raise unittest.SkipTest('wcscoll/wcsxfrm have known bugs')
357356
BaseLocalizedTest.setUp(self)
358357

Misc/NEWS.d/3.14.0a2.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1400,7 +1400,7 @@ The :class:`memoryview` type now supports subscription, making it a
14001400
.. nonce: KlCdgD
14011401
.. section: Core and Builtins
14021402
1403-
Adds :opcode:`LOAD_SMALL_INT` and :opcode:`LOAD_CONST_IMMORTAL`
1403+
Adds :opcode:`LOAD_SMALL_INT` and :opcode:`!LOAD_CONST_IMMORTAL`
14041404
instructions. ``LOAD_SMALL_INT`` pushes a small integer equal to the
14051405
``oparg`` to the stack. ``LOAD_CONST_IMMORTAL`` does the same as
14061406
``LOAD_CONST`` but is more efficient for immortal objects. Removes

0 commit comments

Comments
 (0)