8000 gh-95913: Edit, expand & format Bytecode sect in 3.11 WhatsNew by CAM-Gerlach · Pull Request #98559 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-95913: Edit, expand & format Bytecode sect in 3.11 WhatsNew #98559

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

Merged
merged 13 commits into from
Oct 24, 2022
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Consolidate jump opcode changes further
  • Loading branch information
CAM-Gerlach committed Oct 23, 2022
commit 7c94ab031c4210fe2df80e9db9e626ad7fbc0aca
16 changes: 9 additions & 7 deletions Doc/whatsnew/3.11.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1468,16 +1468,21 @@ Replaced opcodes
| | :opcode:`!JUMP_IF_NOT_EXC_MATCH` | | :opcode:`CHECK_EXC_MATCH` | Now performs check but doesn't jump |
| | :opcode:`!JUMP_IF_NOT_EG_MATCH` | | :opcode:`CHECK_EG_MATCH` | |
+------------------------------------+-----------------------------------+-----------------------------------------+
| | :opcode:`!JUMP_ABSOLUTE` | | :opcode:`JUMP_BACKWARD` | All jump opcodes now relative; |
| | :opcode:`!POP_JUMP_IF_FALSE` | | :opcode:`POP_JUMP_BACKWARD_IF_* | arg is offset from current instruction |
| | :opcode:`!POP_JUMP_IF_TRUE` | <POP_JUMP_BACKWARD_IF_TRUE>` | rather than absolute location; |
| | | :opcode:`POP_JUMP_FORWARD_IF_* | added ``NONE`` & ``NOT_NONE`` variants |
| | :opcode:`!JUMP_ABSOLUTE` | | :opcode:`JUMP_BACKWARD` | See [#bytecode-jump]_; |
| | :opcode:`!POP_JUMP_IF_FALSE` | | :opcode:`POP_JUMP_BACKWARD_IF_* | ``TRUE``, ``FALSE``, |
| | :opcode:`!POP_JUMP_IF_TRUE` | <POP_JUMP_BACKWARD_IF_TRUE>` | ``NONE`` and ``NOT_NONE`` variants |
| | | :opcode:`POP_JUMP_FORWARD_IF_* | for each direction |
| | <POP_JUMP_FORWARD_IF_TRUE>` | |
+------------------------------------+-----------------------------------+-----------------------------------------+
| | :opcode:`!SETUP_WITH` | :opcode:`BEFORE_WITH` | :keyword:`with` block setup |
| | :opcode:`!SETUP_ASYNC_WITH` | | |
+------------------------------------+-----------------------------------+-----------------------------------------+

.. [#bytecode-jump] All jump opcodes are now relative, including the
existing :opcode:`JUMP_IF_TRUE_OR_POP` and :opcode:`JUMP_IF_FALSE_OR_POP`.
The argument is now an offset from the current instruction
rather than an absolute location.


.. _whatsnew311-changed-opcodes:
.. _whatsnew311-removed-opcodes:
Expand All @@ -1486,9 +1491,6 @@ Replaced opcodes
Changed/removed opcodes
-----------------------

* Changed :opcode:`JUMP_IF_TRUE_OR_POP` and :opcode:`JUMP_IF_FALSE_OR_POP`
to be relative rather than absolute.

* Changed :opcode:`MATCH_CLASS` and :opcode:`MATCH_KEYS`
to no longer push an additional boolean value to indicate success/failure.
Instead, ``None`` is pushed on failure
Expand Down
0