[issue16956] Allow signed line number deltas in the code object's line number table

2016-01-20 Thread STINNER Victor

STINNER Victor added the comment:

Good news: this issue has been fixed in issue #26107.

--
resolution:  -> fixed
status: open -> closed
superseder:  -> PEP 511: code.co_lnotab: use signed line number delta to 
support moving instructions in an optimizer

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16956] Allow signed line number deltas in the code object's line number table

2013-02-09 Thread Xavier de Gaye

Changes by Xavier de Gaye xdeg...@gmail.com:


--
nosy: +xdegaye

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16956
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16956] Allow signed line number deltas in the code object's line number table

2013-02-09 Thread Xavier de Gaye

Xavier de Gaye added the comment:

 How does this interact with pdb?

Also, the findlinestarts() function from the dis module computes line
numbers from lnotab. This function is used by pdb when displaying the
lines of a traceback.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16956
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16956] Allow signed line number deltas in the code object's line number table

2013-02-09 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Your patch doesn't seem to work properly: a while loop doesn't generate 
negative line offsets. The reason seems to be that compiler_set_lineno() 
prevents it.
(also, if I re-add the `assert(d_lineno = 0);` in assemble_lnotab(), I don't 
get any crash)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16956
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16956] Allow signed line number deltas in the code object's line number table

2013-01-15 Thread Mark Shannon

Mark Shannon added the comment:

The interaction between bdb/pdb and the line number table is via the 
frame.f_lineno attribute.

Allowing signed offsets changes the one-to-one line muber = bytecode offset 
relation into a one-to-many relation.

Reading frame.f_lineno is not an issue as each bytecode offset will always 
refer to exactly one line number.

Setting frame.f_lineno requires some thought as each line number could 
potentially refer to several bytecode offsets. However, the proposed patch 
retains the one-to-one relation, as the test in the while statement is merely 
moved, not duplicated.

I am reluctant to change frame_setlineno() until there really is a one-to-many 
relation as it will be untestable.
Once a one-to-many relation exists (e.g. duplicating finally blocks to avoid 
'pseudo excpetions') then frame_setlineno should be modified (and tests added)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16956
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16956] Allow signed line number deltas in the code object's line number table

2013-01-14 Thread Antoine Pitrou

Antoine Pitrou added the comment:

How does this interact with pdb?

--
nosy: +georg.brandl, haypo, pitrou
stage:  - patch review
type:  - enhancement
versions: +Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16956
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16956] Allow signed line number deltas in the code object's line number table

2013-01-13 Thread Mark Shannon

New submission from Mark Shannon:

The restriction that line numbers must be monotonically increasing w.r.t 
bytecode offset in the co_lnotab array prevents a number of beneficial 
transformations in the bytecode compiler.

This patch allows negative line number deltas and uses this capability to 
generate code for 'while' loops in standard text book fashion, putting the test 
*after* the body.

--
hgrepos: 172
messages: 179887
nosy: Mark.Shannon
priority: normal
severity: normal
status: open
title: Allow signed line number deltas in the code object's  line number table

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16956
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16956] Allow signed line number deltas in the code object's line number table

2013-01-13 Thread Mark Shannon

Changes by Mark Shannon m...@hotpy.org:


--
keywords: +patch
Added file: http://bugs.python.org/file28718/dd04caae6647.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16956
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com