diff options
author | Mark Shannon <mark@hotpy.org> | 2022-06-27 11:24:23 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-27 11:24:23 (GMT) |
commit | c0453a40faaadb43d2e69767af6c9680f8689063 (patch) | |
tree | d8ab19e5244e552e5d1b371651593be9be5142e4 /Doc/library/dis.rst | |
parent | 33fc3b5e42f241ab81cc6d115711545b4f9e271e (diff) | |
download | cpython-c0453a40faaadb43d2e69767af6c9680f8689063.zip cpython-c0453a40faaadb43d2e69767af6c9680f8689063.tar.gz cpython-c0453a40faaadb43d2e69767af6c9680f8689063.tar.bz2 |
GH-94163: Add BINARY_SLICE and STORE_SLICE instructions. (GH-94168)
Diffstat (limited to 'Doc/library/dis.rst')
-rw-r--r-- | Doc/library/dis.rst | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index 84712bc..4ec2fb0 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -446,12 +446,13 @@ result back on the stack. **Binary and in-place operations** -Binary operations remove the top of the stack (TOS) and the second top-most -stack item (TOS1) from the stack. They perform the operation, and put the -result back on the stack. +In the following, TOS is the top-of-stack. +TOS1, TOS2, TOS3 are the second, thrid and fourth items on the stack, respectively. + +Binary operations remove the top two items from the stack (TOS and TOS1). +They perform the operation, then put the result back on the stack. -In-place operations are like binary operations, in that they remove TOS and -TOS1, and push the result back on the stack, but the operation is done in-place +In-place operations are like binary operations, but the operation is done in-place when TOS1 supports it, and the resulting TOS may be (but does not have to be) the original TOS1. @@ -460,6 +461,7 @@ the original TOS1. Implements the binary and in-place operators (depending on the value of *op*). + ``TOS = TOS1 op TOS``. .. versionadded:: 3.11 @@ -479,6 +481,20 @@ the original TOS1. Implements ``del TOS1[TOS]``. +.. opcode:: BINARY_SLICE + + Implements ``TOS = TOS2[TOS1:TOS]``. + + .. versionadded:: 3.12 + + +.. opcode:: STORE_SLICE + + Implements ``TOS2[TOS1:TOS] = TOS3``. + + .. versionadded:: 3.12 + + **Coroutine opcodes** .. opcode:: GET_AWAITABLE (where) |