Skip to content

gh-95913: edit description of opcodes changes #98566

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 10 additions & 16 deletions Doc/whatsnew/3.11.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1493,35 +1493,29 @@ CPython bytecode changes
indicate failure with :const:`None` (where a tuple of extracted values would
otherwise be).

* Replace several stack manipulation instructions (``DUP_TOP``, ``DUP_TOP_TWO``,
* Replaced several stack manipulation instructions (``DUP_TOP``, ``DUP_TOP_TWO``,
``ROT_TWO``, ``ROT_THREE``, ``ROT_FOUR``, and ``ROT_N``) with new
:opcode:`COPY` and :opcode:`SWAP` instructions.

* Replaced :opcode:`JUMP_IF_NOT_EXC_MATCH` by :opcode:`CHECK_EXC_MATCH` which
performs the check but does not jump.

* Replaced :opcode:`JUMP_IF_NOT_EG_MATCH` by :opcode:`CHECK_EG_MATCH` which
performs the check but does not jump.
* Replaced :opcode:`JUMP_IF_NOT_EXC_MATCH` and :opcode:`JUMP_IF_NOT_EG_MATCH`
by :opcode:`CHECK_EXC_MATCH` and :opcode:`JUMP_IF_NOT_EG_MATCH` which
perform the check but do not jump.

* Replaced :opcode:`JUMP_ABSOLUTE` by the relative :opcode:`JUMP_BACKWARD`.

* Added :opcode:`JUMP_BACKWARD_NO_INTERRUPT`, which is used in certain loops where it
is undesirable to handle interrupts.

* Replaced :opcode:`POP_JUMP_IF_TRUE` and :opcode:`POP_JUMP_IF_FALSE` by
the relative :opcode:`POP_JUMP_FORWARD_IF_TRUE`, :opcode:`POP_JUMP_BACKWARD_IF_TRUE`,
:opcode:`POP_JUMP_FORWARD_IF_FALSE` and :opcode:`POP_JUMP_BACKWARD_IF_FALSE`.

* Added :opcode:`POP_JUMP_FORWARD_IF_NOT_NONE`, :opcode:`POP_JUMP_BACKWARD_IF_NOT_NONE`,
:opcode:`POP_JUMP_FORWARD_IF_NONE` and :opcode:`POP_JUMP_BACKWARD_IF_NONE`
opcodes to speed up conditional jumps.

* :opcode:`JUMP_IF_TRUE_OR_POP` and :opcode:`JUMP_IF_FALSE_OR_POP` are now
relative rather than absolute.
* All jump opcodes are now relative: the arg is an offset from the current
instruction rather than an absolute location to jump to, and the op name
typically includes the direction of the jump (FORWARD/BACKWARD).

* :opcode:`RESUME` has been added. It is a no-op. Performs internal tracing,
debugging and optimization checks.

* opcodes that work with exceptions were adjusted to the change in the
representation of exceptions on the stack from three items to one. (see
:issue:`45711`).

.. _whatsnew311-deprecated:
.. _whatsnew311-python-api-deprecated:
Expand Down