mirror of
https://github.com/python/cpython.git
synced 2026-04-20 10:51:00 +00:00
GH-145668: Add FOR_ITER specialization for virtual iterators. Specialize GET_ITER. (GH-147967)
* Add FOR_ITER_VIRTUAL to specialize FOR_ITER for virtual iterators * Add GET_ITER_SELF to specialize GET_ITER for iterators (including generators) * Add GET_ITER_VIRTUAL to specialize GET_ITER for iterables as virtual iterators * Add new (internal) _tp_iteritem function slot to PyTypeObject * Put limited RESUME at start of genexpr for free-threading. Fix up exception handling in genexpr
This commit is contained in:
parent
0fcf2b72d3
commit
600f4dbd54
37 changed files with 2987 additions and 1534 deletions
|
|
@ -963,7 +963,7 @@ label_exception_targets(basicblock *entryblock) {
|
|||
}
|
||||
else if (instr->i_opcode == RESUME) {
|
||||
instr->i_except = handler;
|
||||
if (instr->i_oparg != RESUME_AT_FUNC_START) {
|
||||
if (instr->i_oparg != RESUME_AT_FUNC_START && instr->i_oparg != RESUME_AT_GEN_EXPR_START) {
|
||||
assert(last_yield_except_depth >= 0);
|
||||
if (last_yield_except_depth == 1) {
|
||||
instr->i_oparg |= RESUME_OPARG_DEPTH1_MASK;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue