mirror of
https://github.com/python/cpython.git
synced 2025-07-08 03:45:36 +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
|
@ -840,7 +840,7 @@ dummy_func(void) {
|
|||
value = sym_new_unknown(ctx);
|
||||
}
|
||||
|
||||
op(_FOR_ITER_GEN_FRAME, (unused -- unused, gen_frame: _Py_UOpsAbstractFrame*)) {
|
||||
op(_FOR_ITER_GEN_FRAME, (unused, unused -- unused, unused, gen_frame: _Py_UOpsAbstractFrame*)) {
|
||||
gen_frame = NULL;
|
||||
/* We are about to hit the end of the trace */
|
||||
ctx->done = true;
|
||||
|
@ -914,7 +914,7 @@ dummy_func(void) {
|
|||
}
|
||||
}
|
||||
|
||||
op(_ITER_NEXT_RANGE, (iter -- iter, next)) {
|
||||
op(_ITER_NEXT_RANGE, (iter, null_or_index -- iter, null_or_index, next)) {
|
||||
next = sym_new_type(ctx, &PyLong_Type);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue