mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
GH-96793: Specialize FOR_ITER for generators. (GH-98772)
This commit is contained in:
parent
80c08d1cd6
commit
4a1c58d504
13 changed files with 207 additions and 71 deletions
|
|
@ -61,6 +61,7 @@ typedef struct _PyInterpreterFrame {
|
|||
// over, or (in the case of a newly-created frame) a totally invalid value:
|
||||
_Py_CODEUNIT *prev_instr;
|
||||
int stacktop; /* Offset of TOS from localsplus */
|
||||
uint16_t yield_offset;
|
||||
bool is_entry; // Whether this is the "root" frame for the current _PyCFrame.
|
||||
char owner;
|
||||
/* Locals and stack */
|
||||
|
|
@ -110,6 +111,7 @@ _PyFrame_InitializeSpecials(
|
|||
frame->frame_obj = NULL;
|
||||
frame->prev_instr = _PyCode_CODE(code) - 1;
|
||||
frame->is_entry = false;
|
||||
frame->yield_offset = 0;
|
||||
frame->owner = FRAME_OWNED_BY_THREAD;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue