From b04dfbbe4bd7071d46c8688c2263726ea31d33cd Mon Sep 17 00:00:00 2001 From: Mark Shannon Date: Thu, 20 Jan 2022 11:46:39 +0000 Subject: 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. --- Lib/opcode.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Lib/opcode.py') diff --git a/Lib/opcode.py b/Lib/opcode.py index 7f39a7bfe2..73b41d22df 100644 --- a/Lib/opcode.py +++ b/Lib/opcode.py @@ -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) -- cgit v1.2.1