mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
GH-127953: Make line number lookup O(1) regardless of the size of the code object (GH-128350)
This commit is contained in:
parent
f7cc7d296c
commit
7239da7559
6 changed files with 214 additions and 163 deletions
|
@ -4816,7 +4816,8 @@ dummy_func(
|
|||
int original_opcode = 0;
|
||||
if (tstate->tracing) {
|
||||
PyCodeObject *code = _PyFrame_GetCode(frame);
|
||||
original_opcode = code->_co_monitoring->lines[(int)(this_instr - _PyFrame_GetBytecode(frame))].original_opcode;
|
||||
int index = (int)(this_instr - _PyFrame_GetBytecode(frame));
|
||||
original_opcode = code->_co_monitoring->lines->data[index*code->_co_monitoring->lines->bytes_per_entry];
|
||||
next_instr = this_instr;
|
||||
} else {
|
||||
original_opcode = _Py_call_instrumentation_line(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue