Uh oh!
There was an error while loading. Please reload this page.
[3.13] GH-127953: Make line number lookup O(1) regardless of the size of the code object - #129127
Conversation
Yhg1s
commented
Apr 2, 2025
@markshannon What's the state of this backport? Should this be considered for 3.13.3 (scheduled next week)? What about 3.12? (There's still time to get it into 3.12 before we stop backporting bugfixes :) |
markshannon
commented
Apr 2, 2025
It needs a review. |
| _Py_CODEUNIT *instr = &_PyCode_CODE(code)[i]; | ||
| int opcode = instr->op.code; | ||
| int base_opcode = _Py_GetBaseOpcode(code, i); | ||
| int base_opcode = _Py_GetBaseCodeUnit(code, i).op.code; |
There was a problem hiding this comment.
| intbase_opcode=_Py_GetBaseCodeUnit(code, i).op.code; | |
| intbase_opcode=_Py_GetBaseOpcode(code, i); |
| active_monitors)); | ||
| int code_len = (int)Py_SIZE(code); | ||
| PyCodeAddressRange range; | ||
| _PyCode_InitAddressRange(co, &range); |
There was a problem hiding this comment.
| _PyCode_InitAddressRange(co, &range); | |
| _PyCode_InitAddressRange(code, &range); |
There was a problem hiding this comment.
This typo is present in main as well, but I figured I'd try building with INSTRUMENT_DEBUG set just the same.
Yhg1s
commented
Apr 7, 2025
(Merging now so this can make it into tomorrow's release, please consider the suggested changes for follow-up.) |
Thanks @markshannon for the PR, and @Yhg1s for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12. |
Sorry, @markshannon and @Yhg1s, I could not cleanly backport this to |
…e size of the code object (python#129127) pythonGH-127953: Make line number lookup O(1) regardless of the size of the code object (pythonGH-128350)
GH-132268 is a backport of this pull request to the 3.12 branch. |
GH-132268 is a backport of this pull request to the 3.12 branch. |
Manual backport of #128350