[issue2506] Add mechanism to disable optimizations

Serhiy Storchaka report at bugs.python.org
Thu May 17 10:17:51 EDT 2018


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

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.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue2506>
_______________________________________


More information about the Python-bugs-list mailing list