[issue26107] PEP 511: code.co_lnotab: use signed line number delta to support moving instructions in an optimizer

2016-01-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset 16f60cd918e0 by Victor Stinner in branch 'default': PEP 511 https://hg.python.org/peps/rev/16f60cd918e0 -- ___ Python tracker

[issue26107] PEP 511: code.co_lnotab: use signed line number delta to support moving instructions in an optimizer

2016-01-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset c6fb1651ea2e by Victor Stinner in branch 'default': Issue #26107: Fix typo in Objects/lnotab_notes.txt https://hg.python.org/cpython/rev/c6fb1651ea2e -- ___ Python tracker

[issue26107] PEP 511: code.co_lnotab: use signed line number delta to support moving instructions in an optimizer

2016-01-20 Thread STINNER Victor
STINNER Victor added the comment: > Nice work, my issue21385 is also related. Basically, transforming non-Python > code into Python meant that all line number information, which otherwise > would have been useful for debugging, had to be discarded, or debug builds of > Python would dump

[issue26107] PEP 511: code.co_lnotab: use signed line number delta to support moving instructions in an optimizer

2016-01-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset 775b74e0e103 by Victor Stinner in branch 'default': co_lnotab supports negative line number delta https://hg.python.org/cpython/rev/775b74e0e103 -- ___ Python tracker

[issue26107] PEP 511: code.co_lnotab: use signed line number delta to support moving instructions in an optimizer

2016-01-20 Thread STINNER Victor
STINNER Victor added the comment: I closed issues #16956 and #21385 as duplicates of this issue. -- ___ Python tracker ___

[issue26107] PEP 511: code.co_lnotab: use signed line number delta to support moving instructions in an optimizer

2016-01-19 Thread Antti Haapala
Antti Haapala added the comment: Nice work, my issue21385 is also related. Basically, transforming non-Python code into Python meant that all line number information, which otherwise would have been useful for debugging, had to be discarded, or debug builds of Python would dump cores. So,

[issue26107] PEP 511: code.co_lnotab: use signed line number delta to support moving instructions in an optimizer

2016-01-18 Thread STINNER Victor
STINNER Victor added the comment: We have many unit test in the Python test suite which rely on exact line numbers. Examples: * test_sys_settrace * test_pdb * test_dis I know them because they were all broken when my fatoptimizer project had bugs related to line numbers :-) With my patch,

[issue26107] PEP 511: code.co_lnotab: use signed line number delta to support moving instructions in an optimizer

2016-01-18 Thread STINNER Victor
STINNER Victor added the comment: Patch version 2 to take Serhiy's review in account: * complete Objects/lnotab_notes.txt update. Replace (300, 300) delta example with (300, 200) delta for better readability (300 is the bytecode offset delta, 200 is the line number delta) * fix added

[issue26107] PEP 511: code.co_lnotab: use signed line number delta to support moving instructions in an optimizer

2016-01-18 Thread STINNER Victor
STINNER Victor added the comment: Brett Cannon added the comment: > I just wanted to comment on "don't change importlib MAGIC: we only change it > between Python minor versions": that's actually not true. Feel free to up the > number whenever you make a change that affects eval.c or bytecode.

[issue26107] PEP 511: code.co_lnotab: use signed line number delta to support moving instructions in an optimizer

2016-01-18 Thread STINNER Victor
STINNER Victor added the comment: Patch version 3: * When I reviewed issue #16956 patch, I noticed that I forgot to extract my changes on codeobject.c :-/ (FAT Python became a giant patch, it's hard to browse it!) * Fix typo in dis.py (regression of patch 2) -- Added file:

[issue26107] PEP 511: code.co_lnotab: use signed line number delta to support moving instructions in an optimizer

2016-01-18 Thread STINNER Victor
STINNER Victor added the comment: > A patch was proposed in issue16956. And issue17611 is related. I don't see directly the link between this issue and the issue17611, but cool if it helps to implement new optimizations :-) I compared my patch with issue16956 patch: * my patch mentions also

[issue26107] PEP 511: code.co_lnotab: use signed line number delta to support moving instructions in an optimizer

2016-01-18 Thread Brett Cannon
Brett Cannon added the comment: I just wanted to comment on "don't change importlib MAGIC: we only change it between Python minor versions": that's actually not true. Feel free to up the number whenever you make a change that affects eval.c or bytecode. Otherwise .pyc files won't be

[issue26107] PEP 511: code.co_lnotab: use signed line number delta to support moving instructions in an optimizer

2016-01-18 Thread STINNER Victor
STINNER Victor added the comment: Patch version 4: * finish to update Objects/lnotab_notes.txt * update _PyCode_CheckLineNumber() in codeobject.c * set importlib MAGIC to 3361 I don't expect my patch to be complete nor perfect. IMHO it's fine to adjust the code later if needed. I would like

[issue26107] PEP 511: code.co_lnotab: use signed line number delta to support moving instructions in an optimizer

2016-01-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: But there is no need to increase it by 10. I suppose the gap is added to allow updating bytecode in maintained releases, but in process of developing next version we don't need this. -- ___ Python tracker

[issue26107] PEP 511: code.co_lnotab: use signed line number delta to support moving instructions in an optimizer

2016-01-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The launcher on Windows does a range check. -- ___ Python tracker ___ ___

[issue26107] PEP 511: code.co_lnotab: use signed line number delta to support moving instructions in an optimizer

2016-01-18 Thread Brett Cannon
Brett Cannon added the comment: There's technically no need to worry about ranged values as the magic number is purely an equality check to see if the interpreter matches what the .pyc was created with. I guess there might be third-party code that does a range check, but that's bad as