[Python-checkins] python/dist/src/Python compile.c,2.289,2.290

rhettinger@users.sourceforge.net rhettinger@users.sourceforge.net
Fri, 20 Jun 2003 09:13:20 -0700


Update of /cvsroot/python/python/dist/src/Python
In directory sc8-pr-cvs1:/tmp/cvs-serv15592

Modified Files:
	compile.c 
Log Message:
Removed bytecode transformation for sequence packing/unpacking.
It depended on the previously removed basic block checker to
prevent a jump into the middle of the transformed block.

Clears SF 757818: tuple assignment -- SystemError: unknown opcode



Index: compile.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v
retrieving revision 2.289
retrieving revision 2.290
diff -C2 -d -r2.289 -r2.290
*** compile.c	22 May 2003 22:00:04 -0000	2.289
--- compile.c	20 Jun 2003 16:13:17 -0000	2.290
***************
*** 364,395 ****
  			break;
  
- 		/* Replace BUILD_SEQN 2 UNPACK_SEQN 2 with ROT2 JMP+2.
- 		   Replace BUILD_SEQN 3 UNPACK_SEQN 3 with ROT3 ROT2 JMP+1.
- 		   Note, these opcodes occur together only in assignment
- 		   statements.  Accordingly, the unpack opcode is never
- 		   a jump target.  */
- 		case BUILD_TUPLE:
- 		case BUILD_LIST:
- 			if (codestr[i+3] != UNPACK_SEQUENCE)
- 				continue;
- 			if (GETARG(codestr, i) == 2 && \
- 			    GETARG(codestr, i+3) == 2) {
- 				codestr[i] = ROT_TWO;
- 				codestr[i+1] = JUMP_FORWARD;
- 				SETARG(codestr, i+1, 2);
- 				codestr[i+4] = DUP_TOP;	 /* Filler codes used as NOPs */
- 				codestr[i+5] = POP_TOP;
- 				continue;
- 			} 
- 			if (GETARG(codestr, i) == 3 && \
- 			    GETARG(codestr, i+3) == 3) {
- 				codestr[i] = ROT_THREE;
- 				codestr[i+1] = ROT_TWO;
- 				codestr[i+2] = JUMP_FORWARD;
- 				SETARG(codestr, i+2, 1);	
- 				codestr[i+5] = DUP_TOP;
- 			}
- 			break;
- 
  		/* Replace jumps to unconditional jumps */
  		case FOR_ITER:
--- 364,367 ----