mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +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
|
@ -679,8 +679,11 @@ NON_ESCAPING_FUNCTIONS = (
|
|||
"PyStackRef_IsTaggedInt",
|
||||
"PyStackRef_TagInt",
|
||||
"PyStackRef_UntagInt",
|
||||
"PyStackRef_IncrementTaggedIntNoOverflow",
|
||||
"PyStackRef_IsNullOrInt",
|
||||
)
|
||||
|
||||
|
||||
def check_escaping_calls(instr: parser.CodeDef, escapes: dict[SimpleStmt, EscapingCall]) -> None:
|
||||
error: lexer.Token | None = None
|
||||
calls = {e.call for e in escapes.values()}
|
||||
|
|
|
@ -140,6 +140,7 @@ class Emitter:
|
|||
) -> bool:
|
||||
if storage.spilled:
|
||||
raise analysis_error("stack_pointer needs reloading before dispatch", tkn)
|
||||
storage.stack.flush(self.out)
|
||||
self.emit(tkn)
|
||||
return False
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue