summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorTian Gao <gaogaotiantian@hotmail.com>2024-03-01 06:46:33 (GMT)
committerGitHub <noreply@github.com>2024-03-01 06:46:33 (GMT)
commit7895a61168aad4565a1d953104c9ec620e7c588f (patch)
tree8234320f8978961688f8abc4baf1f6ad7faf5c2d /Python/ceval.c
parent339c8e1c13adc299a0e2e49c93067e7817692380 (diff)
downloadcpython-7895a61168aad4565a1d953104c9ec620e7c588f.zip
cpython-7895a61168aad4565a1d953104c9ec620e7c588f.tar.gz
cpython-7895a61168aad4565a1d953104c9ec620e7c588f.tar.bz2
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 0a61e237009bf6b833e13ac635299ee063377699.
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 34f286e..f817f28 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -806,23 +806,17 @@ resume_frame:
{
_Py_CODEUNIT *prev = frame->instr_ptr;
_Py_CODEUNIT *here = frame->instr_ptr = next_instr;
- int original_opcode = 0;
- if (tstate->tracing) {
- PyCodeObject *code = _PyFrame_GetCode(frame);
- original_opcode = code->_co_monitoring->lines[(int)(here - _PyCode_CODE(code))].original_opcode;
- } else {
- _PyFrame_SetStackPointer(frame, stack_pointer);
- original_opcode = _Py_call_instrumentation_line(
- tstate, frame, here, prev);
- stack_pointer = _PyFrame_GetStackPointer(frame);
- if (original_opcode < 0) {
- next_instr = here+1;
- goto error;
- }
- next_instr = frame->instr_ptr;
- if (next_instr != here) {
- DISPATCH();
- }
+ _PyFrame_SetStackPointer(frame, stack_pointer);
+ int original_opcode = _Py_call_instrumentation_line(
+ tstate, frame, here, prev);
+ stack_pointer = _PyFrame_GetStackPointer(frame);
+ if (original_opcode < 0) {
+ next_instr = here+1;
+ goto error;
+ }
+ next_instr = frame->instr_ptr;
+ if (next_instr != here) {
+ DISPATCH();
}
if (_PyOpcode_Caches[original_opcode]) {
_PyBinaryOpCache *cache = (_PyBinaryOpCache *)(next_instr+1);