mirror of
https://github.com/python/cpython.git
synced 2025-07-12 05:45:15 +00:00
gh-116098: Revert "gh-107674: Improve performance of sys.settrace
(GH-114986)" (GH-116178)
Revert "gh-107674: Improve performance of `sys.settrace` (GH-114986)"
This reverts commit 0a61e23700
.
This commit is contained in:
parent
339c8e1c13
commit
7895a61168
7 changed files with 53 additions and 64 deletions
|
@ -1156,13 +1156,15 @@ int
|
|||
_Py_call_instrumentation_line(PyThreadState *tstate, _PyInterpreterFrame* frame, _Py_CODEUNIT *instr, _Py_CODEUNIT *prev)
|
||||
{
|
||||
PyCodeObject *code = _PyFrame_GetCode(frame);
|
||||
assert(tstate->tracing == 0);
|
||||
assert(is_version_up_to_date(code, tstate->interp));
|
||||
assert(instrumentation_cross_checks(tstate->interp, code));
|
||||
int i = (int)(instr - _PyCode_CODE(code));
|
||||
|
||||
_PyCoMonitoringData *monitoring = code->_co_monitoring;
|
||||
_PyCoLineInstrumentationData *line_data = &monitoring->lines[i];
|
||||
if (tstate->tracing) {
|
||||
goto done;
|
||||
}
|
||||
PyInterpreterState *interp = tstate->interp;
|
||||
int8_t line_delta = line_data->line_delta;
|
||||
int line = compute_line(code, i, line_delta);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue