mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-46409: Make generators in bytecode (GH-30633)
* Add RETURN_GENERATOR and JUMP_NO_INTERRUPT opcodes. * Trim frame and generator by word each. * Minor refactor of frame.c * Update test.test_sys to account for smaller frames. * Treat generator functions as normal functions when evaluating and specializing.
This commit is contained in:
parent
d05a66339b
commit
b04dfbbe4b
18 changed files with 236 additions and 205 deletions
|
@ -94,6 +94,7 @@ def_op('LOAD_BUILD_CLASS', 71)
|
|||
|
||||
def_op('GET_AWAITABLE', 73)
|
||||
def_op('LOAD_ASSERTION_ERROR', 74)
|
||||
def_op('RETURN_GENERATOR', 75)
|
||||
|
||||
def_op('LIST_TO_TUPLE', 82)
|
||||
def_op('RETURN_VALUE', 83)
|
||||
|
@ -155,7 +156,7 @@ def_op('RAISE_VARARGS', 130) # Number of raise arguments (1, 2, or 3)
|
|||
|
||||
def_op('MAKE_FUNCTION', 132) # Flags
|
||||
def_op('BUILD_SLICE', 133) # Number of items
|
||||
|
||||
jabs_op('JUMP_NO_INTERRUPT', 134) # Target byte offset from beginning of code
|
||||
def_op('MAKE_CELL', 135)
|
||||
hasfree.append(135)
|
||||
def_op('LOAD_CLOSURE', 136)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue