mirror of
https://github.com/python/cpython.git
synced 2025-10-31 21:51:50 +00:00
GH-132554: Fix tier2 FOR_ITER implementation and optimizations (GH-135137)
This commit is contained in:
parent
d9cad074d5
commit
b90ecea9e6
12 changed files with 155 additions and 173 deletions
12
Python/optimizer_cases.c.h
generated
12
Python/optimizer_cases.c.h
generated
|
|
@ -1562,10 +1562,18 @@
|
|||
}
|
||||
|
||||
case _GET_ITER: {
|
||||
JitOptSymbol *iterable;
|
||||
JitOptSymbol *iter;
|
||||
JitOptSymbol *index_or_null;
|
||||
iter = sym_new_not_null(ctx);
|
||||
index_or_null = sym_new_not_null(ctx);
|
||||
iterable = stack_pointer[-1];
|
||||
if (sym_matches_type(iterable, &PyTuple_Type) || sym_matches_type(iterable, &PyList_Type)) {
|
||||
iter = iterable;
|
||||
index_or_null = sym_new_not_null(ctx);
|
||||
}
|
||||
else {
|
||||
iter = sym_new_not_null(ctx);
|
||||
index_or_null = sym_new_unknown(ctx);
|
||||
}
|
||||
stack_pointer[-1] = iter;
|
||||
stack_pointer[0] = index_or_null;
|
||||
stack_pointer += 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue