diff options
author | Mark Shannon <mark@hotpy.org> | 2025-02-27 09:36:41 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-27 09:36:41 (GMT) |
commit | 2a18e80695ac1f05c95ea3b1cfe29defd45e2f71 (patch) | |
tree | 4fec858cc19c76631a9958ba9ca4d049e2c19f50 /Python/bytecodes.c | |
parent | fda056e64bdfcac3dd3d13eebda0a24994d83cb8 (diff) | |
download | cpython-2a18e80695ac1f05c95ea3b1cfe29defd45e2f71.zip cpython-2a18e80695ac1f05c95ea3b1cfe29defd45e2f71.tar.gz cpython-2a18e80695ac1f05c95ea3b1cfe29defd45e2f71.tar.bz2 |
GH-128534: Instrument branches for `async for` loops. (GH-130569)
Diffstat (limited to 'Python/bytecodes.c')
-rw-r--r-- | Python/bytecodes.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Python/bytecodes.c b/Python/bytecodes.c index 9f13095..dc709a7 100644 --- a/Python/bytecodes.c +++ b/Python/bytecodes.c @@ -1339,7 +1339,7 @@ dummy_func( goto exception_unwind; } - tier1 inst(END_ASYNC_FOR, (awaitable_st, exc_st -- )) { + tier1 op(_END_ASYNC_FOR, (awaitable_st, exc_st -- )) { PyObject *exc = PyStackRef_AsPyObjectBorrow(exc_st); assert(exc && PyExceptionInstance_Check(exc)); @@ -1355,6 +1355,16 @@ dummy_func( } } + tier1 op(_MONITOR_BRANCH_RIGHT, ( -- )) { + INSTRUMENTED_JUMP(prev_instr, this_instr+1, PY_MONITORING_EVENT_BRANCH_RIGHT); + } + + macro(INSTRUMENTED_END_ASYNC_FOR) = + _MONITOR_BRANCH_RIGHT + + _END_ASYNC_FOR; + + macro(END_ASYNC_FOR) = _END_ASYNC_FOR; + tier1 inst(CLEANUP_THROW, (sub_iter, last_sent_val, exc_value_st -- none, value)) { PyObject *exc_value = PyStackRef_AsPyObjectBorrow(exc_value_st); #if !Py_TAIL_CALL_INTERP |