summaryrefslogtreecommitdiffstats
path: root/Lib/opcode.py
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2023-02-13 11:24:55 (GMT)
committerGitHub <noreply@github.com>2023-02-13 11:24:55 (GMT)
commit160f2fe2b90ed5ec7838cb4141dd35768422891f (patch)
tree2d9617e40227da45aa8e3c4452eaa0f389a0d879 /Lib/opcode.py
parenta1f08f5f19753c7c9295f51b5ae1262c7a1c838f (diff)
downloadcpython-160f2fe2b90ed5ec7838cb4141dd35768422891f.zip
cpython-160f2fe2b90ed5ec7838cb4141dd35768422891f.tar.gz
cpython-160f2fe2b90ed5ec7838cb4141dd35768422891f.tar.bz2
GH-87849: Simplify stack effect of SEND and specialize it for generators and coroutines. (GH-101788)
Diffstat (limited to 'Lib/opcode.py')
-rw-r--r--Lib/opcode.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/opcode.py b/Lib/opcode.py
index 5f163d2..b69cd1b 100644
--- a/Lib/opcode.py
+++ b/Lib/opcode.py
@@ -167,7 +167,7 @@ def_op('COPY', 120)
def_op('RETURN_CONST', 121)
hasconst.append(121)
def_op('BINARY_OP', 122)
-jrel_op('SEND', 123) # Number of bytes to skip
+jrel_op('SEND', 123) # Number of words to skip
def_op('LOAD_FAST', 124) # Local variable number, no null check
haslocal.append(124)
def_op('STORE_FAST', 125) # Local variable number
@@ -370,6 +370,9 @@ _specializations = {
"UNPACK_SEQUENCE_TUPLE",
"UNPACK_SEQUENCE_TWO_TUPLE",
],
+ "SEND": [
+ "SEND_GEN",
+ ],
}
_specialized_instructions = [
opcode for family in _specializations.values() for opcode in family
@@ -429,6 +432,9 @@ _cache_format = {
"STORE_SUBSCR": {
"counter": 1,
},
+ "SEND": {
+ "counter": 1,
+ },
}
_inline_cache_entries = [