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-11 17:49:46.799740175 +0000 @@ -12,7 +12,7 @@ #define ROT_TWO 2 #define ROT_THREE 3 #define DUP_TOP 4 -#define ROT_FOUR 5 +#define DUP_TOP_TWO 5 #define NOP 9 #define UNARY_POSITIVE 10 @@ -83,7 +83,7 @@ #define DELETE_ATTR 96 /* "" */ #define STORE_GLOBAL 97 /* "" */ #define DELETE_GLOBAL 98 /* "" */ -#define DUP_TOPX 99 /* number of items to duplicate */ + #define LOAD_CONST 100 /* Index in const list */ #define LOAD_NAME 101 /* Index in name list */ #define BUILD_TUPLE 102 /* Number of tuple items */ 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-11 17:53:08.900677188 +0000 @@ -48,7 +48,7 @@ def_op('ROT_TWO', 2) def_op('ROT_THREE', 3) def_op('DUP_TOP', 4) -def_op('ROT_FOUR', 5) +def_op('ROT_TOP_TWO', 5) def_op('NOP', 9) def_op('UNARY_POSITIVE', 10) @@ -116,7 +116,6 @@ name_op('DELETE_ATTR', 96) # "" name_op('STORE_GLOBAL', 97) # "" name_op('DELETE_GLOBAL', 98) # "" -def_op('DUP_TOPX', 99) # number of items to duplicate def_op('LOAD_CONST', 100) # Index in const list hasconst.append(100) name_op('LOAD_NAME', 101) # 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-11 18:42:17.126873020 +0000 @@ -1402,25 +1402,13 @@ SET_THIRD(v); FAST_DISPATCH(); - TARGET(ROT_FOUR) - u = TOP(); - v = SECOND(); - w = THIRD(); - x = FOURTH(); - SET_TOP(v); - SET_SECOND(w); - SET_THIRD(x); - SET_FOURTH(u); - FAST_DISPATCH(); - TARGET(DUP_TOP) v = TOP(); Py_INCREF(v); PUSH(v); FAST_DISPATCH(); - TARGET(DUP_TOPX) - if (oparg == 2) { + TARGET(DUP_TOP_TWO) x = TOP(); Py_INCREF(x); w = SECOND(); @@ -1429,22 +1417,6 @@ SET_TOP(x); SET_SECOND(w); FAST_DISPATCH(); - } else if (oparg == 3) { - x = TOP(); - Py_INCREF(x); - w = SECOND(); - Py_INCREF(w); - v = THIRD(); - Py_INCREF(v); - STACKADJ(3); - SET_TOP(x); - SET_SECOND(w); - SET_THIRD(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) 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-11 18:00:21.266873960 +0000 @@ -680,8 +680,8 @@ return 0; case DUP_TOP: return 1; - case ROT_FOUR: - return 0; + case DUP_TOP_TWO: + return 2; case UNARY_POSITIVE: case UNARY_NEGATIVE: @@ -782,8 +782,6 @@ return -1; case DELETE_GLOBAL: return 0; - case DUP_TOPX: - return oparg; case LOAD_CONST: return 1; case LOAD_NAME: @@ -3404,7 +3402,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-11 17:57:00.409116817 +0000 @@ -4,7 +4,7 @@ &&TARGET_ROT_TWO, &&TARGET_ROT_THREE, &&TARGET_DUP_TOP, - &&TARGET_ROT_FOUR, + &&TARGET_DUP_TOP_TWO, &&_unknown_opcode, &&_unknown_opcode, &&_unknown_opcode, @@ -98,7 +98,7 @@ &&TARGET_DELETE_ATTR, &&TARGET_STORE_GLOBAL, &&TARGET_DELETE_GLOBAL, - &&TARGET_DUP_TOPX, + &&_unknown_opcode, &&TARGET_LOAD_CONST, &&TARGET_LOAD_NAME, &&TARGET_BUILD_TUPLE,