GH-87849: Simplify stack effect of SEND and specialize it for generators and coroutines. (GH-101788)

This commit is contained in:
Mark Shannon 2023-02-13 11:24:55 +00:00 committed by GitHub
parent a1f08f5f19
commit 160f2fe2b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 191 additions and 105 deletions

View file

@ -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 = [