mirror of
https://github.com/python/cpython.git
synced 2025-10-08 08:01:55 +00:00
gh-107674: Improve performance of sys.settrace
(GH-117133)
* Check tracing in RESUME_CHECK * Only change to RESUME_CHECK if not tracing
This commit is contained in:
parent
998c3856c1
commit
9c14ed0618
7 changed files with 63 additions and 52 deletions
|
@ -358,12 +358,16 @@ do { \
|
|||
// for an exception handler, displaying the traceback, and so on
|
||||
#define INSTRUMENTED_JUMP(src, dest, event) \
|
||||
do { \
|
||||
_PyFrame_SetStackPointer(frame, stack_pointer); \
|
||||
next_instr = _Py_call_instrumentation_jump(tstate, event, frame, src, dest); \
|
||||
stack_pointer = _PyFrame_GetStackPointer(frame); \
|
||||
if (next_instr == NULL) { \
|
||||
next_instr = (dest)+1; \
|
||||
goto error; \
|
||||
if (tstate->tracing) {\
|
||||
next_instr = dest; \
|
||||
} else { \
|
||||
_PyFrame_SetStackPointer(frame, stack_pointer); \
|
||||
next_instr = _Py_call_instrumentation_jump(tstate, event, frame, src, dest); \
|
||||
stack_pointer = _PyFrame_GetStackPointer(frame); \
|
||||
if (next_instr == NULL) { \
|
||||
next_instr = (dest)+1; \
|
||||
goto error; \
|
||||
} \
|
||||
} \
|
||||
} while (0);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue