Skip to content

Commit c6bdd52

Browse files
committed
add optimizer op
1 parent a380d57 commit c6bdd52

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

Python/optimizer_bytecodes.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -914,6 +914,13 @@ dummy_func(void) {
914914
}
915915
}
916916

917+
op(_ITER_CHECK_TUPLE, (iter, null_or_index -- iter, null_or_index)) {
918+
if (sym_matches_type(iter, &PyTuple_Type)) {
919+
REPLACE_OP(this_instr, _NOP, 0, 0);
920+
}
921+
sym_set_type(iter, &PyTuple_Type);
922+
}
923+
917924
op(_ITER_NEXT_RANGE, (iter, null_or_index -- iter, null_or_index, next)) {
918925
next = sym_new_type(ctx, &PyLong_Type);
919926
}

Python/optimizer_cases.c.h

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)