[Python-checkins] python/dist/src/Include opcode.h,2.41,2.42
rhettinger@users.sourceforge.net
rhettinger@users.sourceforge.net
Mon, 21 Apr 2003 23:49:11 -0700
Update of /cvsroot/python/python/dist/src/Include
In directory sc8-pr-cvs1:/tmp/cvs-serv4294/Include
Modified Files:
opcode.h
Log Message:
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.
Index: opcode.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/opcode.h,v
retrieving revision 2.41
retrieving revision 2.42
diff -C2 -d -r2.41 -r2.42
*** opcode.h 30 Aug 2002 13:09:49 -0000 2.41
--- opcode.h 22 Apr 2003 06:49:09 -0000 2.42
***************
*** 15,18 ****
--- 15,20 ----
#define ROT_FOUR 5
+ #define NOP 9
+
#define UNARY_POSITIVE 10
#define UNARY_NEGATIVE 11