bpo-27129: Use instruction offsets, not byte offsets, in bytecode and internally.#25069
Conversation
erlend-aasland
left a comment
There was a problem hiding this comment.
One more thing: I'd swap the two PyCode_Addr2Line's in Python/ceval.c with PyFrame_GetLineNumber for improved readability. (Unless the extra function call impacts performance.)
Sorry, something went wrong.
vstinner
left a comment
There was a problem hiding this comment.
Oh... I didn't notice that when the wordcode work has been done. It's unfortunate that we didn't switch to instruction offset. I vaguely recall discussion about sizeof(_Py_CODEUNIT).
I support this change, here are some comments. My main worry is about PyCode_Addr2Line().
Sorry, something went wrong.
|
I wanted to ask to document properly that PyCode_Addr2Line() uses a byte offset, but the function is not documented! Can you please document the function at: Please document f_lasti unit and the change at: https://docs.python.org/dev/library/inspect.html |
Sorry, something went wrong.
|
The comment on There are no changes to the inspect module. |
Sorry, something went wrong.
It's part of the public C API, so people uses it (for good or bad reasons). A search on the top 4000 PyPI projects give me: Hopefully, the list is short. The documentation should describes the behavior, and it's ok to strongly advice to use another function instead ;-) |
Sorry, something went wrong.
|
@vstinner I'm fine with documenting |
Sorry, something went wrong.
…rpreter dispatch a bit, and removes most EXTENDED_ARGs for jumps.
79b3b3b to
325d135
Compare
March 31, 2021 10:12
You should be allowed to click on the CI to "Re-run all jobs" to avoid closing/reopening the PR. Sadly, it's not possible to only re-run a single job. |
Sorry, something went wrong.
Fixup Numba to address the changes introduced in cpython for Python 3.10 at python/cpython#25069 . But for Numba, we have to alter the patch slightly as Numba rewrites the bytecode to use a `_FIXED_OFFSET` with a value of `2`.
Fixup Numba to address the changes introduced in cpython for Python 3.10 at python/cpython#25069 . But for Numba, we have to alter the patch slightly as Numba rewrites the bytecode to use a `_FIXED_OFFSET` with a value of `2`.
Fixup Numba to address the changes introduced in cpython for Python 3.10 at python/cpython#25069 . But for Numba, we have to alter the patch slightly as Numba rewrites the bytecode to use a `_FIXED_OFFSET` with a value of `2`.
Fixup Numba to address the changes introduced in cpython for Python 3.10 at python/cpython#25069 . But for Numba, we have to alter the patch slightly as Numba rewrites the bytecode to use a `_FIXED_OFFSET` with a value of `2`.
Fixup Numba to address the changes introduced in cpython for Python 3.10 at python/cpython#25069 . But for Numba, we have to alter the patch slightly as Numba rewrites the bytecode to use a `_FIXED_OFFSET` with a value of `2`.
f_lastito match, which saves a bit of shifting in the interpreter.https://bugs.python.org/issue27129