mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
GH-132554: "Virtual" iterators (GH-132555)
* FOR_ITER now pushes either the iterator and NULL or leaves the iterable and pushes tagged zero * NEXT_ITER uses the tagged int as the index into the sequence or, if TOS is NULL, iterates as before.
This commit is contained in:
parent
9300a596d3
commit
f6f4e8a662
25 changed files with 713 additions and 618 deletions
11
Python/optimizer_cases.c.h
generated
11
Python/optimizer_cases.c.h
generated
|
@ -126,6 +126,12 @@
|
|||
break;
|
||||
}
|
||||
|
||||
case _POP_ITER: {
|
||||
stack_pointer += -2;
|
||||
assert(WITHIN_STACK_BOUNDS());
|
||||
break;
|
||||
}
|
||||
|
||||
case _END_SEND: {
|
||||
JitOptSymbol *val;
|
||||
val = sym_new_not_null(ctx);
|
||||
|
@ -1557,8 +1563,13 @@
|
|||
|
||||
case _GET_ITER: {
|
||||
JitOptSymbol *iter;
|
||||
JitOptSymbol *index_or_null;
|
||||
iter = sym_new_not_null(ctx);
|
||||
index_or_null = sym_new_not_null(ctx);
|
||||
stack_pointer[-1] = iter;
|
||||
stack_pointer[0] = index_or_null;
|
||||
stack_pointer += 1;
|
||||
assert(WITHIN_STACK_BOUNDS());
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue