mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
GH-118095: Add tier 2 support for YIELD_VALUE (GH-118380)
This commit is contained in:
parent
0f797402bc
commit
5b05d452cd
9 changed files with 92 additions and 16 deletions
1
Include/internal/pycore_opcode_metadata.h
generated
1
Include/internal/pycore_opcode_metadata.h
generated
|
|
@ -1347,6 +1347,7 @@ _PyOpcode_macro_expansion[256] = {
|
|||
[UNPACK_SEQUENCE_TUPLE] = { .nuops = 1, .uops = { { _UNPACK_SEQUENCE_TUPLE, 0, 0 } } },
|
||||
[UNPACK_SEQUENCE_TWO_TUPLE] = { .nuops = 1, .uops = { { _UNPACK_SEQUENCE_TWO_TUPLE, 0, 0 } } },
|
||||
[WITH_EXCEPT_START] = { .nuops = 1, .uops = { { _WITH_EXCEPT_START, 0, 0 } } },
|
||||
[YIELD_VALUE] = { .nuops = 1, .uops = { { _YIELD_VALUE, 0, 0 } } },
|
||||
};
|
||||
#endif // NEED_OPCODE_METADATA
|
||||
|
||||
|
|
|
|||
1
Include/internal/pycore_uop_ids.h
generated
1
Include/internal/pycore_uop_ids.h
generated
|
|
@ -282,6 +282,7 @@ extern "C" {
|
|||
#define _UNPACK_SEQUENCE_TUPLE UNPACK_SEQUENCE_TUPLE
|
||||
#define _UNPACK_SEQUENCE_TWO_TUPLE UNPACK_SEQUENCE_TWO_TUPLE
|
||||
#define _WITH_EXCEPT_START WITH_EXCEPT_START
|
||||
#define _YIELD_VALUE YIELD_VALUE
|
||||
#define MAX_UOP_ID 447
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
|||
4
Include/internal/pycore_uop_metadata.h
generated
4
Include/internal/pycore_uop_metadata.h
generated
|
|
@ -91,6 +91,7 @@ const uint16_t _PyUop_Flags[MAX_UOP_ID+1] = {
|
|||
[_GET_AITER] = HAS_ERROR_FLAG | HAS_ESCAPES_FLAG,
|
||||
[_GET_ANEXT] = HAS_ERROR_FLAG | HAS_ERROR_NO_POP_FLAG | HAS_ESCAPES_FLAG,
|
||||
[_GET_AWAITABLE] = HAS_ARG_FLAG | HAS_ERROR_FLAG | HAS_ESCAPES_FLAG,
|
||||
[_YIELD_VALUE] = HAS_ARG_FLAG | HAS_ESCAPES_FLAG,
|
||||
[_POP_EXCEPT] = HAS_ESCAPES_FLAG,
|
||||
[_LOAD_ASSERTION_ERROR] = 0,
|
||||
[_LOAD_BUILD_CLASS] = HAS_ERROR_FLAG | HAS_ESCAPES_FLAG,
|
||||
|
|
@ -500,6 +501,7 @@ const char *const _PyOpcode_uop_name[MAX_UOP_ID+1] = {
|
|||
[_UNPACK_SEQUENCE_TUPLE] = "_UNPACK_SEQUENCE_TUPLE",
|
||||
[_UNPACK_SEQUENCE_TWO_TUPLE] = "_UNPACK_SEQUENCE_TWO_TUPLE",
|
||||
[_WITH_EXCEPT_START] = "_WITH_EXCEPT_START",
|
||||
[_YIELD_VALUE] = "_YIELD_VALUE",
|
||||
};
|
||||
int _PyUop_num_popped(int opcode, int oparg)
|
||||
{
|
||||
|
|
@ -648,6 +650,8 @@ int _PyUop_num_popped(int opcode, int oparg)
|
|||
return 1;
|
||||
case _GET_AWAITABLE:
|
||||
return 1;
|
||||
case _YIELD_VALUE:
|
||||
return 1;
|
||||
case _POP_EXCEPT:
|
||||
return 1;
|
||||
case _LOAD_ASSERTION_ERROR:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue