Re: [Python-Dev] lnotab and the AST optimizer

2008-07-24 Thread Greg Ewing
Thomas Lee wrote: I'm making some good progress with the AST optimizer, and now the main thing standing in my way is lnotab. My suggestion would be to drop the idea of trying to compress the lnotab in clever ways, and just make it a straightforward list of bytecode offset/line number pairs. I c

Re: [Python-Dev] lnotab and the AST optimizer

2008-07-24 Thread Phillip J. Eby
At 12:56 AM 7/25/2008 +1000, Thomas Lee wrote: I'm making some good progress with the AST optimizer, and now the main thing standing in my way is lnotab. Currently lnotab expects bytecode sequencing to be roughly in-sync with the order of the source file and a few things that the optimizer does

Re: [Python-Dev] lnotab and the AST optimizer

2008-07-24 Thread Thomas Lee
Antoine Pitrou wrote: Thomas Lee vector-seven.com> writes: By the way, you were right about JUMP_IF_TRUE/JUMP_IF_FALSE. It's far too late. Apologies. I'm still pretty sure this is the peepholer's doing, Yes indeed. Which is what's being achieved with the AST optimization I origi

Re: [Python-Dev] lnotab and the AST optimizer

2008-07-24 Thread Antoine Pitrou
Thomas Lee vector-seven.com> writes: > By the way, you were right about JUMP_IF_TRUE/JUMP_IF_FALSE. It's far > too late. Apologies. > > I'm still pretty sure this is the peepholer's doing, Yes indeed. > Which is what's being achieved with the AST optimization I originally > proposed, right?

Re: [Python-Dev] lnotab and the AST optimizer

2008-07-24 Thread Thomas Lee
Antoine Pitrou wrote: Antoine Pitrou pitrou.net> writes: In http://bugs.python.org/issue2459 ("speedup for / while / if with better bytecode") I had the same problem and decided to change the lnotab format so that line number increments are signed bytes rather than unsigned. By the wa

Re: [Python-Dev] lnotab and the AST optimizer

2008-07-24 Thread Thomas Lee
Antoine Pitrou wrote: Hi, Hi. Thanks for getting back to me so quickly. I can even respond before I have to drag myself off to bed. :) I'm making some good progress with the AST optimizer, and now the main thing standing in my way is lnotab. Currently lnotab expects bytecode sequencing t

Re: [Python-Dev] lnotab and the AST optimizer

2008-07-24 Thread Antoine Pitrou
Antoine Pitrou pitrou.net> writes: > > In http://bugs.python.org/issue2459 ("speedup for / while / if with better > bytecode") I had the same problem and decided to change the lnotab format so > that line number increments are signed bytes rather than unsigned. By the way, the same change could

Re: [Python-Dev] lnotab and the AST optimizer

2008-07-24 Thread Antoine Pitrou
Hi, > I'm making some good progress with the AST optimizer, and now the main > thing standing in my way is lnotab. Currently lnotab expects bytecode > sequencing to be roughly in-sync with the order of the source file and a > few things that the optimizer does (e.g. swapping the bodies of an

[Python-Dev] lnotab and the AST optimizer

2008-07-24 Thread Thomas Lee
I'm making some good progress with the AST optimizer, and now the main thing standing in my way is lnotab. Currently lnotab expects bytecode sequencing to be roughly in-sync with the order of the source file and a few things that the optimizer does (e.g. swapping the bodies of an if/else after