Skip to content

Commit 47520ee

Browse files
committed
Convert INSTRUMENTED_FOR_ITER into macro.
1 parent c41d531 commit 47520ee

File tree

8 files changed

+101
-104
lines changed

8 files changed

+101
-104
lines changed

Include/internal/pycore_uop_ids.h

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

Include/opcode_ids.h

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

Lib/_opcode_metadata.py

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

Python/bytecodes.c

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3243,21 +3243,12 @@ dummy_func(
32433243

32443244
macro(FOR_ITER) = _SPECIALIZE_FOR_ITER + _FOR_ITER;
32453245

3246-
3247-
inst(INSTRUMENTED_FOR_ITER, (unused/1, iter, null_or_index[1] -- iter, null_or_index[1], next)) {
3248-
_PyStackRef item = _PyForIter_VirtualIteratorNext(tstate, frame, iter, null_or_index);
3249-
if (!PyStackRef_IsValid(item)) {
3250-
if (PyStackRef_IsError(item)) {
3251-
ERROR_NO_POP();
3252-
}
3253-
// Jump forward by oparg and skip the following END_FOR
3254-
JUMPBY(oparg + 1);
3255-
DISPATCH();
3256-
}
3257-
next = item;
3246+
op(_MONITOR_FOR_ITER, ( -- )) {
32583247
INSTRUMENTED_JUMP(this_instr, next_instr, PY_MONITORING_EVENT_BRANCH_LEFT);
32593248
}
32603249

3250+
macro(INSTRUMENTED_FOR_ITER) = unused/1 + _FOR_ITER + _MONITOR_FOR_ITER;
3251+
32613252
op(_ITER_CHECK_LIST, (iter, null_or_index -- iter, null_or_index)) {
32623253
EXIT_IF(PyStackRef_TYPE(iter) != &PyList_Type);
32633254
assert(PyStackRef_IsTaggedInt(null_or_index));

Python/executor_cases.c.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/generated_cases.c.h

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

Python/opcode_targets.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/optimizer_cases.c.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)