diff -urw cpython-8122deb904e1-old/Include/opcode.h cpython-8122deb904e1/Include/opcode.h --- cpython-8122deb904e1-old/Include/opcode.h 2010-07-04 13:07:10.668582342 +0000 +++ cpython-8122deb904e1/Include/opcode.h 2010-07-05 13:31:41.867254427 +0000 @@ -11,20 +11,24 @@ #define POP_TOP 1 #define ROT_TWO 2 #define ROT_THREE 3 -#define DUP_TOP 4 -#define ROT_FOUR 5 +#define ROT_THREE_TWO 4 +#define DUP_TOP 5 +#define DUP_TOP_TWO 6 +#define DUP_ROT_THREE 7 #define NOP 9 #define UNARY_POSITIVE 10 #define UNARY_NEGATIVE 11 #define UNARY_NOT 12 - -#define UNARY_INVERT 15 - -#define BINARY_POWER 19 - -#define BINARY_MULTIPLY 20 - +#define UNARY_INVERT 13 +#define BINARY_IN 14 /* peephole relies on NOT x == x^1 */ +#define BINARY_NOT_IN 15 /* "" */ +#define BINARY_IS 16 /* "" */ +#define BINARY_IS_NOT 17 /* "" */ + +#define BINARY_EXC_MATCH 19 +#define BINARY_POWER 20 +#define BINARY_MULTIPLY 21 #define BINARY_MODULO 22 #define BINARY_ADD 23 #define BINARY_SUBTRACT 24 @@ -34,6 +38,12 @@ #define INPLACE_FLOOR_DIVIDE 28 #define INPLACE_TRUE_DIVIDE 29 +#define COMPARE_LT 48 /* ceval relies on COMPARE_LT being a multiple of 8 */ +#define COMPARE_LE 49 /* and that each opcode follow in this order */ +#define COMPARE_EQ 50 /* "" */ +#define COMPARE_NE 51 /* "" */ +#define COMPARE_GT 52 /* "" */ +#define COMPARE_GE 53 /* "" */ #define STORE_MAP 54 #define INPLACE_ADD 55 #define INPLACE_SUBTRACT 56 @@ -42,7 +52,6 @@ #define INPLACE_MODULO 59 #define STORE_SUBSCR 60 #define DELETE_SUBSCR 61 - #define BINARY_LSHIFT 62 #define BINARY_RSHIFT 63 #define BINARY_AND 64 @@ -78,7 +87,6 @@ #define FOR_ITER 93 #define UNPACK_EX 94 /* Num items before variable part + (Num items after variable part << 8) */ - #define STORE_ATTR 95 /* Index in name list */ #define DELETE_ATTR 96 /* "" */ #define STORE_GLOBAL 97 /* "" */ @@ -91,7 +99,6 @@ #define BUILD_SET 104 /* Number of set items */ #define BUILD_MAP 105 /* Always zero for now */ #define LOAD_ATTR 106 /* Index in name list */ -#define COMPARE_OP 107 /* Comparison operator */ #define IMPORT_NAME 108 /* Index in name list */ #define IMPORT_FROM 109 /* Index in name list */ @@ -139,17 +146,12 @@ #define SET_ADD 146 #define MAP_ADD 147 - /* EXCEPT_HANDLER is a special, implicit block type which is created when entering an except handler. It is not an opcode but we define it here as we want it to be available to both frameobject.c and ceval.c, while remaining private.*/ #define EXCEPT_HANDLER 257 - -enum cmp_op {PyCmp_LT=Py_LT, PyCmp_LE=Py_LE, PyCmp_EQ=Py_EQ, PyCmp_NE=Py_NE, PyCmp_GT=Py_GT, PyCmp_GE=Py_GE, - PyCmp_IN, PyCmp_NOT_IN, PyCmp_IS, PyCmp_IS_NOT, PyCmp_EXC_MATCH, PyCmp_BAD}; - #define HAS_ARG(op) ((op) >= HAVE_ARGUMENT) #ifdef __cplusplus diff -urw cpython-8122deb904e1-old/Lib/opcode.py cpython-8122deb904e1/Lib/opcode.py --- cpython-8122deb904e1-old/Lib/opcode.py 2010-07-04 13:07:10.947457526 +0000 +++ cpython-8122deb904e1/Lib/opcode.py 2010-07-05 14:05:48.472724322 +0000 @@ -4,19 +4,15 @@ operate on bytecodes (e.g. peephole optimizers). """ -__all__ = ["cmp_op", "hasconst", "hasname", "hasjrel", "hasjabs", - "haslocal", "hascompare", "hasfree", "opname", "opmap", +__all__ = ["hasconst", "hasname", "hasjrel", "hasjabs", + "haslocal", "hasfree", "opname", "opmap", "HAVE_ARGUMENT", "EXTENDED_ARG"] -cmp_op = ('<', '<=', '==', '!=', '>', '>=', 'in', 'not in', 'is', - 'is not', 'exception match', 'BAD') - hasconst = [] hasname = [] hasjrel = [] hasjabs = [] haslocal = [] -hascompare = [] hasfree = [] opmap = {} @@ -47,19 +43,24 @@ def_op('POP_TOP', 1) def_op('ROT_TWO', 2) def_op('ROT_THREE', 3) -def_op('DUP_TOP', 4) -def_op('ROT_FOUR', 5) +def_op('ROT_THREE_TWO', 4) +def_op('DUP_TOP', 5) +def_op('DUP_TOP_TWO', 6) +def_op('DUP_ROT_THREE', 7) def_op('NOP', 9) def_op('UNARY_POSITIVE', 10) def_op('UNARY_NEGATIVE', 11) def_op('UNARY_NOT', 12) - -def_op('UNARY_INVERT', 15) - -def_op('BINARY_POWER', 19) -def_op('BINARY_MULTIPLY', 20) - +def_op('UNARY_INVERT', 13) +def_op('BINARY_IN', 14) # peephole relies on NOT x == x^1 +def_op('BINARY_NOT_IN', 15) # "" +def_op('BINARY_IS', 16) # "" +def_op('BINARY_IS_NOT', 17) # "" + +def_op('BINARY_EXC_MATCH', 19) +def_op('BINARY_POWER', 20) +def_op('BINARY_MULTIPLY', 21) def_op('BINARY_MODULO', 22) def_op('BINARY_ADD', 23) def_op('BINARY_SUBTRACT', 24) @@ -69,6 +70,12 @@ def_op('INPLACE_FLOOR_DIVIDE', 28) def_op('INPLACE_TRUE_DIVIDE', 29) +def_op('COMPARE_LT',48) +def_op('COMPARE_LE',49) +def_op('COMPARE_EQ',50) +def_op('COMPARE_NE',51) +def_op('COMPARE_GT',52) +def_op('COMPARE_GE',53) def_op('STORE_MAP', 54) def_op('INPLACE_ADD', 55) def_op('INPLACE_SUBTRACT', 56) @@ -125,8 +132,7 @@ def_op('BUILD_SET', 104) # Number of set items def_op('BUILD_MAP', 105) # Number of dict entries (upto 255) name_op('LOAD_ATTR', 106) # Index in name list -def_op('COMPARE_OP', 107) # Comparison operator -hascompare.append(107) + name_op('IMPORT_NAME', 108) # Index in name list name_op('IMPORT_FROM', 109) # Index in name list diff -urw cpython-8122deb904e1-old/Python/ceval.c cpython-8122deb904e1/Python/ceval.c --- cpython-8122deb904e1-old/Python/ceval.c 2010-07-04 13:07:10.989840439 +0000 +++ cpython-8122deb904e1/Python/ceval.c 2010-07-05 13:26:04.417256572 +0000 @@ -131,7 +131,6 @@ static int maybe_call_line_trace(Py_tracefunc, PyObject *, PyFrameObject *, int *, int *, int *); -static PyObject * cmp_outcome(int, PyObject *, PyObject *); static PyObject * import_from(PyObject *, PyObject *); static int import_all_from(PyObject *, PyObject *); static void format_exc_check_arg(PyObject *, const char *, PyObject *); @@ -1286,6 +1285,7 @@ fast_next_opcode: f->f_lasti = INSTR_OFFSET(); + f->f_lasti = INSTR_OFFSET(); /* line-by-line tracing support */ @@ -1402,15 +1402,13 @@ SET_THIRD(v); FAST_DISPATCH(); - TARGET(ROT_FOUR) - u = TOP(); - v = SECOND(); - w = THIRD(); - x = FOURTH(); - SET_TOP(v); + TARGET(ROT_THREE_TWO) + v = TOP(); + w = SECOND(); + x = THIRD(); + SET_TOP(x); SET_SECOND(w); - SET_THIRD(x); - SET_FOURTH(u); + SET_THIRD(v); FAST_DISPATCH(); TARGET(DUP_TOP) @@ -1419,8 +1417,7 @@ PUSH(v); FAST_DISPATCH(); - TARGET(DUP_TOPX) - if (oparg == 2) { + TARGET(DUP_TOP_TWO) x = TOP(); Py_INCREF(x); w = SECOND(); @@ -1428,24 +1425,17 @@ STACKADJ(2); SET_TOP(x); SET_SECOND(w); + PREDICT(BINARY_SUBSCR); FAST_DISPATCH(); - } else if (oparg == 3) { - x = TOP(); - Py_INCREF(x); - w = SECOND(); - Py_INCREF(w); - v = THIRD(); + + TARGET(DUP_ROT_THREE) + v = TOP(); Py_INCREF(v); - STACKADJ(3); - SET_TOP(x); - SET_SECOND(w); - SET_THIRD(v); + w = SECOND(); + SET_TOP(w); + SET_SECOND(v); + PUSH(v); FAST_DISPATCH(); - } - Py_FatalError("invalid argument to DUP_TOPX" - " (bytecode corruption?)"); - /* Never returns, so don't bother to set why. */ - break; TARGET(UNARY_POSITIVE) v = TOP(); @@ -1489,6 +1479,109 @@ if (x != NULL) DISPATCH(); break; + TARGET(BINARY_IN) + { + w = POP(); + v = TOP(); + int res = PySequence_Contains(w, v); + if (res < 0){ + Py_DECREF(v); + Py_DECREF(w); + SET_TOP(NULL); + x = NULL; + break; + } + x = res ? Py_True : Py_False; + Py_DECREF(v); + Py_DECREF(w); + Py_INCREF(x); + SET_TOP(x); + PREDICT(POP_JUMP_IF_FALSE); + PREDICT(POP_JUMP_IF_TRUE); + DISPATCH(); + } + + TARGET(BINARY_NOT_IN) + { + w = POP(); + v = TOP(); + int res = PySequence_Contains(w, v); + if (res < 0){ + Py_DECREF(v); + Py_DECREF(w); + SET_TOP(NULL); + x = NULL; + break; + } + x = res ? Py_False : Py_True; + Py_DECREF(v); + Py_DECREF(w); + Py_INCREF(x); + SET_TOP(x); + PREDICT(POP_JUMP_IF_FALSE); + PREDICT(POP_JUMP_IF_TRUE); + DISPATCH(); + } + + TARGET(BINARY_IS) + w = POP(); + v = TOP(); + x = v == w ? Py_True : Py_False; + Py_DECREF(v); + Py_DECREF(w); + Py_INCREF(x); + SET_TOP(x); + PREDICT(POP_JUMP_IF_FALSE); + PREDICT(POP_JUMP_IF_TRUE); + FAST_DISPATCH(); + + TARGET(BINARY_IS_NOT) + w = POP(); + v = TOP(); + x = v != w ? Py_True : Py_False; + Py_DECREF(v); + Py_DECREF(w); + Py_INCREF(x); + SET_TOP(x); + PREDICT(POP_JUMP_IF_FALSE); + PREDICT(POP_JUMP_IF_TRUE); + FAST_DISPATCH(); + + TARGET(BINARY_EXC_MATCH) + w = POP(); + v = TOP(); + if (PyTuple_Check(w)) { + Py_ssize_t i, length; + length = PyTuple_Size(w); + for (i = 0; i < length; i++) { + PyObject *exc = PyTuple_GET_ITEM(w, i); + if (!PyExceptionClass_Check(exc)) { + PyErr_SetString(PyExc_TypeError, "catching classes" + " that do not inherit from BaseException is not" + " allowed"); + Py_DECREF(v); + Py_DECREF(w); + SET_TOP(NULL); + break; + } + } + } + else if (!PyExceptionClass_Check(w)) { + PyErr_SetString(PyExc_TypeError, "catching classes" + " that do not inherit from BaseException is not allowed"); + Py_DECREF(v); + Py_DECREF(w); + SET_TOP(NULL); + break; + } + x = PyErr_GivenExceptionMatches(v, w)? Py_True : Py_False; + Py_DECREF(v); + Py_DECREF(w); + Py_INCREF(x); + SET_TOP(x); + PREDICT(POP_JUMP_IF_FALSE); + DISPATCH(); + TARGET(BINARY_POWER) w = POP(); v = TOP(); @@ -1571,6 +1664,7 @@ if (x != NULL) DISPATCH(); break; + PREDICTED(BINARY_SUBSCR); TARGET(BINARY_SUBSCR) w = POP(); v = TOP(); @@ -2278,10 +2372,15 @@ if (x != NULL) DISPATCH(); break; - TARGET(COMPARE_OP) + TARGET(COMPARE_LT) + TARGET(COMPARE_LE) + TARGET(COMPARE_EQ) + TARGET(COMPARE_NE) + TARGET(COMPARE_GT) + TARGET(COMPARE_GE) w = POP(); v = TOP(); - x = cmp_outcome(oparg, v, w); + x = PyObject_RichCompare(v, w, opcode&7); Py_DECREF(v); Py_DECREF(w); SET_TOP(x); @@ -4221,61 +4320,6 @@ return 1; } -#define CANNOT_CATCH_MSG "catching classes that do not inherit from "\ - "BaseException is not allowed" - -static PyObject * -cmp_outcome(int op, register PyObject *v, register PyObject *w) -{ - int res = 0; - switch (op) { - case PyCmp_IS: - res = (v == w); - break; - case PyCmp_IS_NOT: - res = (v != w); - break; - case PyCmp_IN: - res = PySequence_Contains(w, v); - if (res < 0) - return NULL; - break; - case PyCmp_NOT_IN: - res = PySequence_Contains(w, v); - if (res < 0) - return NULL; - res = !res; - break; - case PyCmp_EXC_MATCH: - if (PyTuple_Check(w)) { - Py_ssize_t i, length; - length = PyTuple_Size(w); - for (i = 0; i < length; i += 1) { - PyObject *exc = PyTuple_GET_ITEM(w, i); - if (!PyExceptionClass_Check(exc)) { - PyErr_SetString(PyExc_TypeError, - CANNOT_CATCH_MSG); - return NULL; - } - } - } - else { - if (!PyExceptionClass_Check(w)) { - PyErr_SetString(PyExc_TypeError, - CANNOT_CATCH_MSG); - return NULL; - } - } - res = PyErr_GivenExceptionMatches(v, w); - break; - default: - return PyObject_RichCompare(v, w, op); - } - v = res ? Py_True : Py_False; - Py_INCREF(v); - return v; -} - static PyObject * import_from(PyObject *v, PyObject *name) { diff -urw cpython-8122deb904e1-old/Python/compile.c cpython-8122deb904e1/Python/compile.c --- cpython-8122deb904e1-old/Python/compile.c 2010-07-04 13:07:10.979840451 +0000 +++ cpython-8122deb904e1/Python/compile.c 2010-07-05 13:33:23.737253411 +0000 @@ -677,11 +677,14 @@ return -1; case ROT_TWO: case ROT_THREE: + case ROT_THREE_TWO: return 0; case DUP_TOP: return 1; - case ROT_FOUR: - return 0; + case DUP_TOP_TWO: + return 2; + case DUP_ROT_THREE: + return 1; case UNARY_POSITIVE: case UNARY_NEGATIVE: @@ -694,7 +697,11 @@ return -1; case MAP_ADD: return -2; - + case BINARY_IN: + case BINARY_NOT_IN: + case BINARY_IS: + case BINARY_IS_NOT: + case BINARY_EXC_MATCH: case BINARY_POWER: case BINARY_MULTIPLY: case BINARY_MODULO: @@ -782,8 +789,6 @@ return -1; case DELETE_GLOBAL: return 0; - case DUP_TOPX: - return oparg; case LOAD_CONST: return 1; case LOAD_NAME: @@ -796,7 +801,12 @@ return 1; case LOAD_ATTR: return 0; - case COMPARE_OP: + case COMPARE_LT: + case COMPARE_LE: + case COMPARE_EQ: + case COMPARE_NE: + case COMPARE_GT: + case COMPARE_GE: return -1; case IMPORT_NAME: return -1; @@ -1919,7 +1929,7 @@ [tb, val, exc] L1: DUP ) [tb, val, exc, exc] ) - [tb, val, exc, exc, E1] COMPARE_OP EXC_MATCH ) only if E1 + [tb, val, exc, exc, E1] BINARY_EXC_MATCH ) only if E1 [tb, val, exc, 1-or-0] POP_JUMP_IF_FALSE L2 ) [tb, val, exc] POP [tb, val] (or POP if no V1) @@ -1971,7 +1981,7 @@ if (handler->v.ExceptHandler.type) { ADDOP(c, DUP_TOP); VISIT(c, expr, handler->v.ExceptHandler.type); - ADDOP_I(c, COMPARE_OP, PyCmp_EXC_MATCH); + ADDOP(c, BINARY_EXC_MATCH); ADDOP_JABS(c, POP_JUMP_IF_FALSE, except); } ADDOP(c, POP_TOP); @@ -2395,27 +2405,27 @@ { switch (op) { case Eq: - return PyCmp_EQ; + return COMPARE_EQ; case NotEq: - return PyCmp_NE; + return COMPARE_NE; case Lt: - return PyCmp_LT; + return COMPARE_LT; case LtE: - return PyCmp_LE; + return COMPARE_LE; case Gt: - return PyCmp_GT; + return COMPARE_GT; case GtE: - return PyCmp_GE; + return COMPARE_GE; case Is: - return PyCmp_IS; + return BINARY_IS; case IsNot: - return PyCmp_IS_NOT; + return BINARY_IS_NOT; case In: - return PyCmp_IN; + return BINARY_IN; case NotIn: - return PyCmp_NOT_IN; + return BINARY_NOT_IN; default: - return PyCmp_BAD; + return -1; } } @@ -2675,7 +2685,7 @@ static int compiler_compare(struct compiler *c, expr_ty e) { - int i, n; + int i, n, t; basicblock *cleanup = NULL; /* XXX the logic can be cleaned up for 1 or multiple comparisons */ @@ -2690,11 +2700,11 @@ (expr_ty)asdl_seq_GET(e->v.Compare.comparators, 0)); } for (i = 1; i < n; i++) { - ADDOP(c, DUP_TOP); - ADDOP(c, ROT_THREE); - ADDOP_I(c, COMPARE_OP, - cmpop((cmpop_ty)(asdl_seq_GET( - e->v.Compare.ops, i - 1)))); + ADDOP(c, DUP_ROT_THREE); + t = cmpop((cmpop_ty)(asdl_seq_GET(e->v.Compare.ops, i - 1))); + if (t != -1) { + ADDOP(c, t); + } else compiler_error(c, "invalid comparison op"); ADDOP_JABS(c, JUMP_IF_FALSE_OR_POP, cleanup); NEXT_BLOCK(c); if (i < (n - 1)) @@ -2702,8 +2712,10 @@ (expr_ty)asdl_seq_GET(e->v.Compare.comparators, i)); } VISIT(c, expr, (expr_ty)asdl_seq_GET(e->v.Compare.comparators, n - 1)); - ADDOP_I(c, COMPARE_OP, - cmpop((cmpop_ty)(asdl_seq_GET(e->v.Compare.ops, n - 1)))); + t = cmpop((cmpop_ty)(asdl_seq_GET(e->v.Compare.ops, n - 1))); + if (t != -1) { + ADDOP(c, t); + } else compiler_error(c, "invalid comparison op"); if (n > 1) { basicblock *end = compiler_new_block(c); if (end == NULL) @@ -3404,7 +3416,7 @@ return 0; } if (ctx == AugLoad) { - ADDOP_I(c, DUP_TOPX, 2); + ADDOP(c, DUP_TOP_TWO); } else if (ctx == AugStore) { ADDOP(c, ROT_THREE); diff -urw cpython-8122deb904e1-old/Python/opcode_targets.h cpython-8122deb904e1/Python/opcode_targets.h --- cpython-8122deb904e1-old/Python/opcode_targets.h 2010-07-04 15:29:09.429845926 +0000 +++ cpython-8122deb904e1/Python/opcode_targets.h 2010-07-05 13:40:23.197254652 +0000 @@ -3,24 +3,24 @@ &&TARGET_POP_TOP, &&TARGET_ROT_TWO, &&TARGET_ROT_THREE, + &&TARGET_ROT_THREE_TWO, &&TARGET_DUP_TOP, - &&TARGET_ROT_FOUR, - &&_unknown_opcode, - &&_unknown_opcode, + &&TARGET_DUP_TOP_TWO, + &&TARGET_DUP_ROT_THREE, &&_unknown_opcode, &&TARGET_NOP, &&TARGET_UNARY_POSITIVE, &&TARGET_UNARY_NEGATIVE, &&TARGET_UNARY_NOT, - &&_unknown_opcode, - &&_unknown_opcode, &&TARGET_UNARY_INVERT, + &&TARGET_BINARY_IN, + &&TARGET_BINARY_NOT_IN, + &&TARGET_BINARY_IS, + &&TARGET_BINARY_IS_NOT, &&_unknown_opcode, - &&_unknown_opcode, - &&_unknown_opcode, + &&TARGET_BINARY_EXC_MATCH, &&TARGET_BINARY_POWER, &&TARGET_BINARY_MULTIPLY, - &&_unknown_opcode, &&TARGET_BINARY_MODULO, &&TARGET_BINARY_ADD, &&TARGET_BINARY_SUBTRACT, @@ -47,12 +47,12 @@ &&_unknown_opcode, &&_unknown_opcode, &&_unknown_opcode, - &&_unknown_opcode, - &&_unknown_opcode, - &&_unknown_opcode, - &&_unknown_opcode, - &&_unknown_opcode, - &&_unknown_opcode, + &&TARGET_COMPARE_LT, + &&TARGET_COMPARE_LE, + &&TARGET_COMPARE_EQ, + &&TARGET_COMPARE_NE, + &&TARGET_COMPARE_GT, + &&TARGET_COMPARE_GE, &&TARGET_STORE_MAP, &&TARGET_INPLACE_ADD, &&TARGET_INPLACE_SUBTRACT, @@ -106,7 +106,7 @@ &&TARGET_BUILD_SET, &&TARGET_BUILD_MAP, &&TARGET_LOAD_ATTR, - &&TARGET_COMPARE_OP, + &&_unknown_opcode, &&TARGET_IMPORT_NAME, &&TARGET_IMPORT_FROM, &&TARGET_JUMP_FORWARD, diff -urw cpython-8122deb904e1-old/Python/peephole.c cpython-8122deb904e1/Python/peephole.c --- cpython-8122deb904e1-old/Python/peephole.c 2010-07-04 13:07:10.989840439 +0000 +++ cpython-8122deb904e1/Python/peephole.c 2010-07-05 00:48:29.991082438 +0000 @@ -315,7 +315,7 @@ to be appended. To keep the optimizer simple, it bails out (does nothing) for code that - has a length over 32,700, and does not calculate extended arguments. + has a length over 32,767, and does not calculate extended arguments. That allows us to avoid overflow and sign issues. Likewise, it bails when the lineno table has complex encoding for gaps >= 255. EXTENDED_ARG can appear before MAKE_FUNCTION; in this case both opcodes are skipped. @@ -356,7 +356,7 @@ /* Avoid situations where jump retargeting could overflow */ assert(PyBytes_Check(code)); codelen = PyBytes_GET_SIZE(code); - if (codelen > 32700) + if (codelen&~0x7FFF) goto exitUnchanged; /* Make a modifiable copy of the code string */ @@ -409,14 +409,15 @@ not a is not b --> a is b not a not in b --> a in b */ - case COMPARE_OP: - j = GETARG(codestr, i); - if (j < 6 || j > 9 || - codestr[i+3] != UNARY_NOT || - !ISBASICBLOCK(blocks,i,4)) + case BINARY_IN: + case BINARY_NOT_IN: + case BINARY_IS: + case BINARY_IS_NOT: + if (!ISBASICBLOCK(blocks,i,2) || + codestr[i+1]!=UNARY_NOT) continue; - SETARG(codestr, i, (j^1)); - codestr[i+3] = NOP; + codestr[i] ^= 1; + codestr[i+1] = NOP; break; /* Replace LOAD_GLOBAL/LOAD_NAME None/True/False @@ -462,10 +463,8 @@ ((opcode == BUILD_TUPLE && ISBASICBLOCK(blocks, h, 3*(j+1))) || ((opcode == BUILD_LIST || opcode == BUILD_SET) && - codestr[i+3]==COMPARE_OP && - ISBASICBLOCK(blocks, h, 3*(j+2)) && - (GETARG(codestr,i+3)==6 || - GETARG(codestr,i+3)==7))) && + (codestr[i+3]==BINARY_IN || codestr[i+3]==BINARY_NOT_IN) && + ISBASICBLOCK(blocks, h, 3*j+4))) && tuple_of_constants(&codestr[h], j, consts)) { assert(codestr[i] == LOAD_CONST); cumlc = 1; @@ -481,9 +480,8 @@ codestr[i] = ROT_TWO; memset(codestr+i+1, NOP, 5); } else if (j == 3) { - codestr[i] = ROT_THREE; - codestr[i+1] = ROT_TWO; - memset(codestr+i+2, NOP, 4); + codestr[i] = ROT_THREE_TWO; + memset(codestr+i+1, NOP, 5); } break;