summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2022-04-11 09:40:24 (GMT)
committerGitHub <noreply@github.com>2022-04-11 09:40:24 (GMT)
commitdd207a6ac52d4bd9a71cf178fc1d5c17a6f07aff (patch)
treec196769c21e856595b8c90adc5205b2372234f02 /Doc
parent98ff4a68773c49619d486c7e758ebbe1662f8387 (diff)
downloadcpython-dd207a6ac52d4bd9a71cf178fc1d5c17a6f07aff.zip
cpython-dd207a6ac52d4bd9a71cf178fc1d5c17a6f07aff.tar.gz
cpython-dd207a6ac52d4bd9a71cf178fc1d5c17a6f07aff.tar.bz2
bpo-47120: make POP_JUMP_IF_TRUE/FALSE/NONE/NOT_NONE relative (GH-32400)
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/dis.rst48
-rw-r--r--Doc/whatsnew/3.11.rst15
2 files changed, 49 insertions, 14 deletions
diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst
index fa0e23a..657778c 100644
--- a/Doc/library/dis.rst
+++ b/Doc/library/dis.rst
@@ -937,30 +937,58 @@ iterations of the loop.
.. versionadded:: 3.11
-.. opcode:: POP_JUMP_IF_TRUE (target)
+.. opcode:: POP_JUMP_FORWARD_IF_TRUE (delta)
- If TOS is true, sets the bytecode counter to *target*. TOS is popped.
+ If TOS is true, increments the bytecode counter by *delta*. TOS is popped.
- .. versionadded:: 3.1
+ .. versionadded:: 3.11
-.. opcode:: POP_JUMP_IF_FALSE (target)
+.. opcode:: POP_JUMP_BACKWARD_IF_TRUE (delta)
- If TOS is false, sets the bytecode counter to *target*. TOS is popped.
+ If TOS is true, decrements the bytecode counter by *delta*. TOS is popped.
- .. versionadded:: 3.1
+ .. versionadded:: 3.11
+
+
+.. opcode:: POP_JUMP_FORWARD_IF_FALSE (delta)
+
+ If TOS is false, increments the bytecode counter by *delta*. TOS is popped.
+
+ .. versionadded:: 3.11
+
+
+.. opcode:: POP_JUMP_BACKWARD_IF_FALSE (delta)
+
+ If TOS is false, decrements the bytecode counter by *delta*. TOS is popped.
+
+ .. versionadded:: 3.11
+
+
+.. opcode:: POP_JUMP_FORWARD_IF_NOT_NONE (delta)
+
+ If TOS is not ``None``, increments the bytecode counter by *delta*. TOS is popped.
+
+ .. versionadded:: 3.11
+
+
+.. opcode:: POP_JUMP_BACKWARD_IF_NOT_NONE (delta)
+
+ If TOS is not ``None``, decrements the bytecode counter by *delta*. TOS is popped.
+
+ .. versionadded:: 3.11
-.. opcode:: POP_JUMP_IF_NOT_NONE (target)
+.. opcode:: POP_JUMP_FORWARD_IF_NONE (delta)
- If TOS is not none, sets the bytecode counter to *target*. TOS is popped.
+ If TOS is ``None``, increments the bytecode counter by *delta*. TOS is popped.
.. versionadded:: 3.11
-.. opcode:: POP_JUMP_IF_NONE (target)
+.. opcode:: POP_JUMP_BACKWARD_IF_NONE (delta)
- If TOS is none, sets the bytecode counter to *target*. TOS is popped.
+ If TOS is ``None``, decrements the bytecode counter by *delta*. TOS is popped.
.. versionadded:: 3.11
diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst
index 870330c..df0b0a7 100644
--- a/Doc/whatsnew/3.11.rst
+++ b/Doc/whatsnew/3.11.rst
@@ -750,9 +750,6 @@ CPython bytecode changes
``ROT_TWO``, ``ROT_THREE``, ``ROT_FOUR``, and ``ROT_N``) with new
:opcode:`COPY` and :opcode:`SWAP` instructions.
-* Add :opcode:`POP_JUMP_IF_NOT_NONE` and :opcode:`POP_JUMP_IF_NONE` opcodes to
- speed up conditional jumps.
-
* Replaced :opcode:`JUMP_IF_NOT_EXC_MATCH` by :opcode:`CHECK_EXC_MATCH` which
performs the check but does not jump.
@@ -761,7 +758,17 @@ CPython bytecode changes
* 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.
+* 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.
+
Deprecated
==========