This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients Sergey.Kirpichev, THRlWiTi, Trip.Volpe, ajaksu2, alex, amaury.forgeotdarc, barry, belopolsky, brett.cannon, diana, eric.araujo, eric.snow, ethan.furman, flox, nedbat, pgimeno, rhettinger, serhiy.storchaka, terry.reedy, tshepang, vstinner
Date 2018-05-17.14:17:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1526566671.04.0.682650639539.issue2506@psf.upfronthosting.co.za>
In-reply-to
Content
Few different optimizations work together here. Folding constants at the AST level allows to eliminate the constant expression statement in the code generation stage. This makes 'continue' a first statement in the 'if' body. Boolean expressions optimizations (performed in the code generation stage now) creates a conditional jump to the start of the 'if' body (which is 'continue' now). If 'continue' is not nested in 'try' or 'with' blocks, it is compiled to an unconditional jump. And finally the jump optimization in the peepholer retargets the conditional jump from the unconditional jump to the start of the loop.
History
Date User Action Args
2018-05-17 14:17:51serhiy.storchakasetrecipients: + serhiy.storchaka, barry, brett.cannon, rhettinger, terry.reedy, amaury.forgeotdarc, belopolsky, vstinner, ajaksu2, nedbat, eric.araujo, alex, flox, THRlWiTi, ethan.furman, tshepang, eric.snow, diana, Trip.Volpe, pgimeno, Sergey.Kirpichev
2018-05-17 14:17:51serhiy.storchakasetmessageid: <1526566671.04.0.682650639539.issue2506@psf.upfronthosting.co.za>
2018-05-17 14:17:51serhiy.storchakalinkissue2506 messages
2018-05-17 14:17:50serhiy.storchakacreate