diff options
author | Irit Katriel <1055913+iritkatriel@users.noreply.github.com> | 2022-04-05 11:06:22 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-05 11:06:22 (GMT) |
commit | 32091df41ce6e3a71df2cf37dc74b728c0d885f2 (patch) | |
tree | 0504c15f15a9ba83d08e480cc33a801cc648681d /Doc | |
parent | 6c6e0408a663c1f53dad403f54a18d444da39cb7 (diff) | |
download | cpython-32091df41ce6e3a71df2cf37dc74b728c0d885f2.zip cpython-32091df41ce6e3a71df2cf37dc74b728c0d885f2.tar.gz cpython-32091df41ce6e3a71df2cf37dc74b728c0d885f2.tar.bz2 |
bpo-47186: Replace JUMP_IF_NOT_EG_MATCH by CHECK_EG_MATCH + jump (GH-32309)
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/dis.rst | 45 | ||||
-rw-r--r-- | Doc/whatsnew/3.11.rst | 3 |
2 files changed, 25 insertions, 23 deletions
diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index b364e3f..63d8467 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -635,6 +635,28 @@ iterations of the loop. .. versionadded:: 3.11 +.. opcode:: CHECK_EG_MATCH + + Performs exception matching for ``except*``. Applies ``split(TOS)`` on + the exception group representing TOS1. + + In case of a match, pops two items from the stack and pushes the + non-matching subgroup (``None`` in case of full match) followed by the + matching subgroup. When there is no match, pops one item (the match + type) and pushes ``None``. + + .. versionadded:: 3.11 + +.. opcode:: PREP_RERAISE_STAR + + Combines the raised and reraised exceptions list from TOS, into an exception + group to propagate from a try-except* block. Uses the original exception + group from TOS1 to reconstruct the structure of reraised exceptions. Pops + two items from the stack and pushes the exception to reraise or ``None`` + if there isn't one. + + .. versionadded:: 3.11 + .. opcode:: WITH_EXCEPT_START Calls the function in position 4 on the stack with arguments (type, val, tb) @@ -922,18 +944,6 @@ iterations of the loop. .. versionadded:: 3.1 -.. opcode:: JUMP_IF_NOT_EG_MATCH (target) - - Performs exception matching for ``except*``. Applies ``split(TOS)`` on - the exception group representing TOS1. Jumps if no match is found. - - Pops one item from the stack (the match type). If a match was found, - next item (the exception) and pushes the non-matching part of the - exception group followed by the matching part. - - .. versionadded:: 3.11 - - .. opcode:: POP_JUMP_IF_NOT_NONE (target) If TOS is not none, sets the bytecode counter to *target*. TOS is popped. @@ -948,17 +958,6 @@ iterations of the loop. .. versionadded:: 3.11 -.. opcode:: PREP_RERAISE_STAR - - Combines the raised and reraised exceptions list from TOS, into an exception - group to propagate from a try-except* block. Uses the original exception - group from TOS1 to reconstruct the structure of reraised exceptions. Pops - two items from the stack and pushes the exception to reraise or ``None`` - if there isn't one. - - .. versionadded:: 3.11 - - .. opcode:: JUMP_IF_TRUE_OR_POP (target) If TOS is true, sets the bytecode counter to *target* and leaves TOS on the diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst index c607aad..fae85d8 100644 --- a/Doc/whatsnew/3.11.rst +++ b/Doc/whatsnew/3.11.rst @@ -523,6 +523,9 @@ CPython bytecode changes * 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_ABSOLUTE` by the relative :opcode:`JUMP_BACKWARD`. Deprecated |