[Python-checkins] r86740 - python/branches/dmalcolm-ast-optimization-branch/Python/peephole.c

david.malcolm python-checkins at python.org
Thu Nov 25 00:27:14 CET 2010


Author: david.malcolm
Date: Thu Nov 25 00:27:14 2010
New Revision: 86740

Log:
Add the JUMP_IF_SPECIALIZABLE opcode to the peepholer (fixing the jump target fixer-upper, and other places)


Modified:
   python/branches/dmalcolm-ast-optimization-branch/Python/peephole.c

Modified: python/branches/dmalcolm-ast-optimization-branch/Python/peephole.c
==============================================================================
--- python/branches/dmalcolm-ast-optimization-branch/Python/peephole.c	(original)
+++ python/branches/dmalcolm-ast-optimization-branch/Python/peephole.c	Thu Nov 25 00:27:14 2010
@@ -14,10 +14,10 @@
 #define GETARG(arr, i) ((int)((arr[i+2]<<8) + arr[i+1]))
 #define UNCONDITIONAL_JUMP(op)  (op==JUMP_ABSOLUTE || op==JUMP_FORWARD)
 #define CONDITIONAL_JUMP(op) (op==POP_JUMP_IF_FALSE || op==POP_JUMP_IF_TRUE \
-    || op==JUMP_IF_FALSE_OR_POP || op==JUMP_IF_TRUE_OR_POP)
+    || op==JUMP_IF_FALSE_OR_POP || op==JUMP_IF_TRUE_OR_POP || op==JUMP_IF_SPECIALIZABLE)
 #define ABSOLUTE_JUMP(op) (op==JUMP_ABSOLUTE || op==CONTINUE_LOOP \
     || op==POP_JUMP_IF_FALSE || op==POP_JUMP_IF_TRUE \
-    || op==JUMP_IF_FALSE_OR_POP || op==JUMP_IF_TRUE_OR_POP)
+    || op==JUMP_IF_FALSE_OR_POP || op==JUMP_IF_TRUE_OR_POP || op==JUMP_IF_SPECIALIZABLE)
 #define JUMPS_ON_TRUE(op) (op==POP_JUMP_IF_TRUE || op==JUMP_IF_TRUE_OR_POP)
 #define GETJUMPTGT(arr, i) (GETARG(arr,i) + (ABSOLUTE_JUMP(arr[i]) ? 0 : i+3))
 #define SETARG(arr, i, val) arr[i+2] = val>>8; arr[i+1] = val & 255
@@ -661,6 +661,7 @@
             case POP_JUMP_IF_TRUE:
             case JUMP_IF_FALSE_OR_POP:
             case JUMP_IF_TRUE_OR_POP:
+            case JUMP_IF_SPECIALIZABLE:
                 j = addrmap[GETARG(codestr, i)];
                 SETARG(codestr, i, j);
                 break;


More information about the Python-checkins mailing list