Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Include/internal/pycore_opcode_metadata.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions Include/internal/pycore_uop_ids.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 0 additions & 15 deletions Include/internal/pycore_uop_metadata.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions Lib/test/test_capi/test_opt.py
Original file line number Diff line number Diff line change
Expand Up @@ -6079,6 +6079,21 @@ def g():
PYTHON_JIT="1", PYTHON_JIT_STRESS="1")
self.assertEqual(result[0].rc, 0, result)

def test_pop_iter(self):
def testfunc(n):
for _ in range(n):
Comment thread
brijkapadia marked this conversation as resolved.
for _ in range(5):
pass

self._run_with_optimizer(testfunc, TIER2_THRESHOLD*2)
all_ex = get_all_executors(testfunc)

self.assertEqual(len(all_ex), 3)
pop_iter_ex = all_ex[1]

self.assertEqual(count_ops(pop_iter_ex, "_POP_TOP"), 1)
self.assertEqual(count_ops(pop_iter_ex, "_POP_TOP_NOP"), 1)

def test_call_kw(self):
def func(a):
return int(a) * 42
Expand Down
28 changes: 17 additions & 11 deletions Modules/_testinternalcapi/test_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions Python/bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,12 +400,7 @@ dummy_func(
PyStackRef_CLOSE(value);
}


inst(POP_ITER, (iter, index_or_null -- )) {
(void)index_or_null;
DEAD(index_or_null);
PyStackRef_CLOSE(iter);
}
macro(POP_ITER) = _POP_TOP_NOP + POP_TOP;

no_save_ip tier1 inst(INSTRUMENTED_END_FOR, (receiver, index_or_null, value -- receiver, index_or_null)) {
/* Need to create a fake StopIteration error here,
Expand Down
22 changes: 0 additions & 22 deletions Python/executor_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 17 additions & 11 deletions Python/generated_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions Python/optimizer_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading