Author nascheme
Recipients Demur Rumed, Mark.Shannon, benjamin.peterson, christian.heimes, mark.dickinson, nascheme, ncoghlan, pitrou, rhettinger, serhiy.storchaka, trent
Date 2017-12-04.17:53:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1512409988.04.0.213398074469.issue17611@psf.upfronthosting.co.za>
In-reply-to
Content
After studying the patch and doing some reading, I prefer the finally-block duplication approach as well.  Java does it that way as well and it works for them.  It would be be interesting to compile a large body of packages and see what the increase in bytecode size actually is with the duplication.  My gut feeling is that it will not be a big deal.

There is a bug with the PR regarding the final bodies.  Exits from the final body cause the whole fblock stack to unwind, not just the blocks enclosing the final body.  Unwind looks at 'c' to get the fblock stack. I think we need to allocate fblockinfo on the C stack and then use a back pointer to enclosing block.  When you get into a final body that creates its own fblockinfo (e.g. a try/except inside the finally), the current code doesn't work.

The fact that the whole test suite passes with these issues tells me that the amount of stuff happening in final bodies must be pretty simple in most code.  

I spent a good part of Sunday trying to understand how the PR works.  It seems to me that the ceval/bytecode changes are pretty solid.  The compiler needs some bug fixes.  Further optimisations could be done at a later time.  I'm curious to see Serhiy's approach though.
History
Date User Action Args
2017-12-04 17:53:08naschemesetrecipients: + nascheme, rhettinger, mark.dickinson, ncoghlan, pitrou, christian.heimes, benjamin.peterson, trent, Mark.Shannon, serhiy.storchaka, Demur Rumed
2017-12-04 17:53:08naschemesetmessageid: <1512409988.04.0.213398074469.issue17611@psf.upfronthosting.co.za>
2017-12-04 17:53:08naschemelinkissue17611 messages
2017-12-04 17:53:07naschemecreate