bpo-27129: Use instruction offsets, not byte offsets, in bytecode and internally. (GH-25069)

* Use instruction offset, rather than bytecode offset. Streamlines interpreter dispatch a bit, and removes most EXTENDED_ARGs for jumps.

* Change some uses of PyCode_Addr2Line to PyFrame_GetLineNumber
This commit is contained in:
Mark Shannon
2021-04-01 16:00:31 +01:00
committed by GitHub
parent 2ac0515027
commit fcb55c0037
14 changed files with 4568 additions and 4569 deletions

View File

@@ -1246,7 +1246,7 @@ PyTypeObject PyCode_Type = {
int
PyCode_Addr2Line(PyCodeObject *co, int addrq)
{
if (addrq == -1) {
if (addrq < 0) {
return co->co_firstlineno;
}
assert(addrq >= 0 && addrq < PyBytes_GET_SIZE(co->co_code));