]> granicus.if.org Git - python/commit
Improved the bytecode optimizer.
authorRaymond Hettinger <python@rcn.com>
Tue, 22 Apr 2003 06:49:11 +0000 (06:49 +0000)
committerRaymond Hettinger <python@rcn.com>
Tue, 22 Apr 2003 06:49:11 +0000 (06:49 +0000)
commit060641d51160f6bf49a049bb677f8412b5a19de3
tree1ad7d568e797a6387b7f0792f5286f901b8f4f32
parent0c83348d5c110a6ca706219019e97d5cefe2fddb
Improved the bytecode optimizer.
* Can now test for basic blocks.
* Optimize inverted comparisions.
* Optimize unary_not followed by a conditional jump.
* Added a new opcode, NOP, to keep code size constant.
* Applied NOP to previous transformations where appropriate.

Note, the NOP would not be necessary if other functions were
added to re-target jump addresses and update the co_lnotab mapping.
That would yield slightly faster and cleaner bytecode at the
expense of optimizer simplicity and of keeping it decoupled
from the line-numbering structure.
Include/opcode.h
Lib/opcode.py
Misc/NEWS
Python/ceval.c
Python/compile.c