mirror of
https://github.com/python/cpython.git
synced 2025-08-23 18:24:46 +00:00
GH-128534: Instrument branches for async for
loops. (GH-130569)
This commit is contained in:
parent
fda056e64b
commit
2a18e80695
11 changed files with 140 additions and 35 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue