summaryrefslogtreecommitdiffstats
path: root/Include/opcode.h
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2003-04-22 06:49:11 (GMT)
committerRaymond Hettinger <python@rcn.com>2003-04-22 06:49:11 (GMT)
commit060641d51160f6bf49a049bb677f8412b5a19de3 (patch)
tree1ad7d568e797a6387b7f0792f5286f901b8f4f32 /Include/opcode.h
parent0c83348d5c110a6ca706219019e97d5cefe2fddb (diff)
downloadcpython-060641d51160f6bf49a049bb677f8412b5a19de3.zip
cpython-060641d51160f6bf49a049bb677f8412b5a19de3.tar.gz
cpython-060641d51160f6bf49a049bb677f8412b5a19de3.tar.bz2
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.
Diffstat (limited to 'Include/opcode.h')
-rw-r--r--Include/opcode.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/Include/opcode.h b/Include/opcode.h
index 2f3dd04..9f7d263 100644
--- a/Include/opcode.h
+++ b/Include/opcode.h
@@ -14,6 +14,8 @@ extern "C" {
#define DUP_TOP 4
#define ROT_FOUR 5
+#define NOP 9
+
#define UNARY_POSITIVE 10
#define UNARY_NEGATIVE 11
#define UNARY_NOT 12