mirror of
https://github.com/python/cpython.git
synced 2025-07-30 22:54:16 +00:00
gh-109094: replace frame->prev_instr by frame->instr_ptr (#109095)
This commit is contained in:
parent
573eff3e2e
commit
67a91f78e4
23 changed files with 249 additions and 164 deletions
|
@ -62,7 +62,7 @@ _PyUopExecute(_PyExecutorObject *executor, _PyInterpreterFrame *frame, PyObject
|
|||
PyUnicode_AsUTF8(_PyFrame_GetCode(frame)->co_qualname),
|
||||
PyUnicode_AsUTF8(_PyFrame_GetCode(frame)->co_filename),
|
||||
_PyFrame_GetCode(frame)->co_firstlineno,
|
||||
2 * (long)(frame->prev_instr + 1 -
|
||||
2 * (long)(frame->instr_ptr -
|
||||
(_Py_CODEUNIT *)_PyFrame_GetCode(frame)->co_code_adaptive));
|
||||
|
||||
PyThreadState *tstate = _PyThreadState_GET();
|
||||
|
@ -131,6 +131,7 @@ error:
|
|||
// The caller recovers the frame from tstate->current_frame.
|
||||
DPRINTF(2, "Error: [Opcode %d, operand %" PRIu64 "]\n", opcode, operand);
|
||||
OPT_HIST(trace_uop_execution_counter, trace_run_length_hist);
|
||||
frame->return_offset = 0; // Don't leave this random
|
||||
_PyFrame_SetStackPointer(frame, stack_pointer);
|
||||
Py_DECREF(self);
|
||||
return NULL;
|
||||
|
@ -140,7 +141,7 @@ deoptimize:
|
|||
// This presumes nothing was popped from the stack (nor pushed).
|
||||
DPRINTF(2, "DEOPT: [Opcode %d, operand %" PRIu64 "]\n", opcode, operand);
|
||||
OPT_HIST(trace_uop_execution_counter, trace_run_length_hist);
|
||||
frame->prev_instr--; // Back up to just before destination
|
||||
frame->return_offset = 0; // Dispatch to frame->instr_ptr
|
||||
_PyFrame_SetStackPointer(frame, stack_pointer);
|
||||
Py_DECREF(self);
|
||||
return frame;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue