[Python-checkins] python/dist/src/Objects codeobject.c, 1.1, 2.1 frameobject.c, 2.79, 2.80 funcobject.c, 2.68, 2.69 typeobject.c, 2.269, 2.270

jhylton@users.sourceforge.net jhylton at users.sourceforge.net
Thu Oct 20 21:59:28 CEST 2005


Update of /cvsroot/python/python/dist/src/Objects
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2121/Objects

Modified Files:
	frameobject.c funcobject.c typeobject.c 
Added Files:
	codeobject.c 
Log Message:
Merge ast-branch to head

This change implements a new bytecode compiler, based on a
transformation of the parse tree to an abstract syntax defined in
Parser/Python.asdl.

The compiler implementation is not complete, but it is in stable
enough shape to run the entire test suite excepting two disabled
tests. 




Index: frameobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/frameobject.c,v
retrieving revision 2.79
retrieving revision 2.80
diff -u -d -r2.79 -r2.80
--- frameobject.c	2 Jul 2004 06:41:06 -0000	2.79
+++ frameobject.c	20 Oct 2005 19:59:24 -0000	2.80
@@ -3,6 +3,7 @@
 
 #include "Python.h"
 
+#include "code.h"
 #include "compile.h"
 #include "frameobject.h"
 #include "opcode.h"

Index: funcobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/funcobject.c,v
retrieving revision 2.68
retrieving revision 2.69
diff -u -d -r2.68 -r2.69
--- funcobject.c	17 Feb 2005 10:37:21 -0000	2.68
+++ funcobject.c	20 Oct 2005 19:59:24 -0000	2.69
@@ -2,7 +2,7 @@
 /* Function object implementation */
 
 #include "Python.h"
-#include "compile.h"
+#include "code.h"
 #include "eval.h"
 #include "structmember.h"
 
@@ -144,7 +144,9 @@
 		Py_XINCREF(closure);
 	}
 	else {
-		PyErr_SetString(PyExc_SystemError, "non-tuple closure");
+		PyErr_Format(PyExc_SystemError, 
+			     "expected tuple for closure, got '%.100s'",
+			     closure->ob_type->tp_name);
 		return -1;
 	}
 	Py_XDECREF(((PyFunctionObject *) op) -> func_closure);

Index: typeobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v
retrieving revision 2.269
retrieving revision 2.270
diff -u -d -r2.269 -r2.270
--- typeobject.c	24 Sep 2005 22:58:41 -0000	2.269
+++ typeobject.c	20 Oct 2005 19:59:24 -0000	2.270
@@ -1737,20 +1737,14 @@
 			goto bad_slots;
 		for (i = j = 0; i < nslots; i++) {
 			char *s;
-			char buffer[256];
 			tmp = PyTuple_GET_ITEM(slots, i);
 			s = PyString_AS_STRING(tmp);
 			if ((add_dict && strcmp(s, "__dict__") == 0) ||
 			    (add_weak && strcmp(s, "__weakref__") == 0))
 				continue;
-			if (_Py_Mangle(PyString_AS_STRING(name),
-				       PyString_AS_STRING(tmp),
-				       buffer, sizeof(buffer)))
-			{
-				tmp = PyString_FromString(buffer);
-			} else {
-				Py_INCREF(tmp);
-			}
+			tmp =_Py_Mangle(name, tmp);
+                        if (!tmp)
+                            goto bad_slots;
 			PyTuple_SET_ITEM(newslots, j, tmp);
 			j++;
 		}



More information about the Python-checkins mailing list