GH-132554: Fix tier2 FOR_ITER implementation and optimizations (GH-135137)

This commit is contained in:
Mark Shannon 2025-06-05 18:53:57 +01:00 committed by GitHub
parent d9cad074d5
commit b90ecea9e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 155 additions and 173 deletions

View file

@ -840,6 +840,17 @@ dummy_func(void) {
value = sym_new_unknown(ctx);
}
op(_GET_ITER, (iterable -- iter, index_or_null)) {
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);
}
}
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 */