From: Armin R. <ar...@us...> - 2003-01-30 18:42:22
|
Update of /cvsroot/psyco/psyco/c/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv23752/Objects Modified Files: pclassobject.c pstringobject.c pstringobject.h Log Message: working... Index: pclassobject.c =================================================================== RCS file: /cvsroot/psyco/psyco/c/Objects/pclassobject.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** pclassobject.c 17 Jan 2003 14:41:17 -0000 1.7 --- pclassobject.c 30 Jan 2003 18:41:48 -0000 1.8 *************** *** 33,37 **** vinfo_t* im_self; vinfo_t* im_class; ! if (forking) return true; /* get the fields from the Python object 'methobj' */ --- 33,37 ---- vinfo_t* im_self; vinfo_t* im_class; ! if (forking) return psyco_forking(po, methobj->array); /* get the fields from the Python object 'methobj' */ Index: pstringobject.c =================================================================== RCS file: /cvsroot/psyco/psyco/c/Objects/pstringobject.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** pstringobject.c 23 Jan 2003 14:20:38 -0000 1.6 --- pstringobject.c 30 Jan 2003 18:41:49 -0000 1.7 *************** *** 62,68 **** static source_virtual_t psyco_computed_strslice; - #define STRSLICE_SOURCE CHARACTER_TOTAL - #define STRSLICE_START (STRSLICE_SOURCE+1) - #define STRSLICE_TOTAL (STRSLICE_START+1) /* a virtual string obtained as a slice of a source string STRSLICE_SOURCE. The slice range is defined as [STRSLICE_START:STRSLICE_START+FIX_SIZE] */ --- 62,65 ---- *************** *** 100,104 **** /* forget fields that were only relevant in virtual-time */ ! vinfo_array_shrink(po, v, CHARACTER_TOTAL); /* move the resulting non-virtual Python object back into 'v' */ --- 97,102 ---- /* forget fields that were only relevant in virtual-time */ ! vinfo_setitem(po, v, STRSLICE_SOURCE, NULL); ! vinfo_setitem(po, v, STRSLICE_START, NULL); /* move the resulting non-virtual Python object back into 'v' */ *************** *** 125,131 **** static source_virtual_t psyco_computed_catstr; - #define CATSTR_LIST CHARACTER_TOTAL - #define CATSTR_TOTAL (CATSTR_LIST+1) - /* a virtual string defined as the concatenation of all the strings in a given list. The list must not be user-visible nor shared in --- 123,126 ---- *************** *** 310,314 **** complete: /* forget fields that were only relevant in virtual-time */ ! vinfo_array_shrink(po, v, CHARACTER_TOTAL); /* move the resulting non-virtual Python object back into 'v' */ --- 305,309 ---- complete: /* forget fields that were only relevant in virtual-time */ ! vinfo_setitem(po, v, CATSTR_LIST, NULL); /* move the resulting non-virtual Python object back into 'v' */ Index: pstringobject.h =================================================================== RCS file: /cvsroot/psyco/psyco/c/Objects/pstringobject.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** pstringobject.h 17 Jan 2003 14:41:38 -0000 1.6 --- pstringobject.h 30 Jan 2003 18:41:49 -0000 1.7 *************** *** 11,25 **** #define STR_ob_sval FARRAY(UNSIGNED_FIELD(PyStringObject, char, ob_sval, \ ! FIX_size)) #define iSTR_OB_SVAL FIELD_INDEX(STR_ob_sval) #define CHARACTER_char UNSIGNED_FIELD(PyStringObject, char, ob_sval, \ ! FIX_size) #define iCHARACTER_CHAR FIELD_INDEX(CHARACTER_char) #define CHARACTER_TOTAL FIELDS_TOTAL(CHARACTER_char) ! #define CHARACTER_short UNSIGNED_FIELD(PyStringObject, short,ob_sval, FIX_size) ! #define CHARACTER_long UNSIGNED_FIELD(PyStringObject, long, ob_sval, FIX_size) --- 11,41 ---- + /* all flavors of virtual strings */ + #define VIRTUALSTR_FIRST FIELDS_TOTAL(FIX_size) + #define VIRTUALSTR_LAST (VIRTUALSTR_FIRST+1) /* <-- keep up-to-date !! */ + + /* virtual string slices */ + #define STRSLICE_SOURCE VIRTUALSTR_FIRST + #define STRSLICE_START (STRSLICE_SOURCE+1) + #define STRSLICE_TOTAL (STRSLICE_START+1) + + /* virtual string concatenations */ + #define CATSTR_LIST VIRTUALSTR_FIRST + #define CATSTR_TOTAL (CATSTR_LIST+1) + + /* all string representations end with the actual character data: */ #define STR_ob_sval FARRAY(UNSIGNED_FIELD(PyStringObject, char, ob_sval, \ ! (defield_t) VIRTUALSTR_LAST)) #define iSTR_OB_SVAL FIELD_INDEX(STR_ob_sval) #define CHARACTER_char UNSIGNED_FIELD(PyStringObject, char, ob_sval, \ ! (defield_t) VIRTUALSTR_LAST) #define iCHARACTER_CHAR FIELD_INDEX(CHARACTER_char) #define CHARACTER_TOTAL FIELDS_TOTAL(CHARACTER_char) ! #define CHARACTER_short FARRAY(UNSIGNED_FIELD(PyStringObject, short,ob_sval, \ ! (defield_t) VIRTUALSTR_LAST)) ! #define CHARACTER_long FARRAY(UNSIGNED_FIELD(PyStringObject, long, ob_sval, \ ! (defield_t) VIRTUALSTR_LAST)) |