update to 1.5.1.

This commit is contained in:
fgsch 2006-09-21 14:41:50 +00:00
parent 59c75c0ec1
commit e366de8a9e
6 changed files with 8 additions and 137 deletions

View File

@ -1,12 +1,12 @@
# $OpenBSD: Makefile,v 1.4 2006/06/03 09:37:09 alek Exp $
# $OpenBSD: Makefile,v 1.5 2006/09/21 14:41:50 fgsch Exp $
COMMENT= "extension module to speed up the execution of Python code"
SHARED_ONLY= Yes
ONLY_FOR_ARCHS= i386
DISTNAME= psyco-1.4-src
PKGNAME= py-${DISTNAME:S/-src//}p1
DISTNAME= psyco-1.5.1-src
PKGNAME= py-${DISTNAME:S/-src//}
CATEGORIES= devel
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=psyco/}

View File

@ -1,4 +1,4 @@
MD5 (psyco-1.4-src.tar.gz) = b1365ceaa40a75326d3deb48edf0c8cc
RMD160 (psyco-1.4-src.tar.gz) = 9520355ea9e55f6c910e6c0563bc2ea8f3a17535
SHA1 (psyco-1.4-src.tar.gz) = 965d2b8fdecde3f1fb3a1855b697b53da66fa058
SIZE (psyco-1.4-src.tar.gz) = 345871
MD5 (psyco-1.5.1-src.tar.gz) = 89e629d27acda765f01aa870230d1162
RMD160 (psyco-1.5.1-src.tar.gz) = 7f34031c6ac6a61d74409d82b40f2fbe1e08519e
SHA1 (psyco-1.5.1-src.tar.gz) = 1467bd2808def48d34d435622ebbd3f7c694684a
SIZE (psyco-1.5.1-src.tar.gz) = 361314

View File

@ -1,84 +0,0 @@
$OpenBSD: patch-c_Objects_pobject_c,v 1.1 2005/06/08 22:24:01 fgsch Exp $
--- c/Objects/pobject.c.orig Tue Sep 7 06:07:05 2004
+++ c/Objects/pobject.c Wed Jun 8 19:15:52 2005
@@ -586,6 +586,80 @@ vinfo_t* PsycoObject_RichCompareBool(Psy
return diff;
}
+static vinfo_t* collect_undeletable_vars(vinfo_t* vi, vinfo_t* link)
+{
+ int i;
+ PyTypeObject* tp;
+ switch (gettime(vi->source)) {
+
+ case RunTime:
+ if (vi->tmp != NULL || (vi->source & RunTime_NoRef) != 0)
+ break; /* already seen or not holding a ref */
+ tp = Psyco_KnownType(vi);
+ if (tp && (tp == &PyInt_Type || tp == &PyString_Type ||
+#if BOOLEAN_TYPE
+ tp == &PyBool_Type ||
+#endif
+ tp == &PyFloat_Type || tp == &PyLong_Type ||
+ tp == &PyRange_Type))
+ break; /* known safe type */
+ /* make a linked list of results */
+ vi->tmp = link;
+ link = vi;
+ break;
+
+ case VirtualTime:
+ for (i=vi->array->count; i--; )
+ if (vi->array->items[i] != NULL)
+ link = collect_undeletable_vars(
+ vi->array->items[i], link);
+ break;
+
+ default:
+ break;
+ }
+ return link;
+}
+
+DEFINEFN
+vinfo_t* Psyco_SafelyDeleteVar(PsycoObject* po, vinfo_t* vi)
+{
+ vinfo_t* result;
+ vinfo_t* head;
+ vinfo_t* queue = (vinfo_t*) 1;
+ vinfo_t* p;
+ int count;
+ vi->tmp = NULL;
+ clear_tmp_marks(vi->array);
+
+ head = collect_undeletable_vars(vi, queue);
+ count = 0;
+ for (p = head; p != queue; p = p->tmp) {
+ vinfo_array_t* a = p->array;
+ p->array = NullArray;
+ array_delete(a, po);
+ count++;
+ }
+ if (count == 0) {
+ result = psyco_vi_Zero();
+ }
+ else if (count == 1) {
+ result = head;
+ vinfo_incref(result);
+ }
+ else {
+ result = vinfo_new(
+ VirtualTime_New(&psyco_vsource_not_important));
+ count += iOB_TYPE + 1;
+ result->array = array_new(count);
+ for (p = head; p != queue; p = p->tmp) {
+ vinfo_incref(p);
+ result->array->items[--count] = p;
+ }
+ }
+ return result;
+}
+
INITIALIZATIONFN
void psy_object_init(void)

View File

@ -1,12 +0,0 @@
$OpenBSD: patch-c_Objects_pobject_h,v 1.1 2005/06/08 22:24:01 fgsch Exp $
--- c/Objects/pobject.h.orig Wed Sep 3 11:30:04 2003
+++ c/Objects/pobject.h Wed Jun 8 19:14:18 2005
@@ -181,5 +181,8 @@ EXTERNVAR fixed_switch_t psyfs_none;
/* NOTE: don't forget to update pobject.c when adding new variables here */
#endif
+/* for dispatcher.c */
+EXTERNFN vinfo_t* Psyco_SafelyDeleteVar(PsycoObject* po, vinfo_t* vi);
+
#endif /* _PSY_OBJECT_H */

View File

@ -1,31 +0,0 @@
$OpenBSD: patch-c_dispatcher_c,v 1.1 2005/06/08 22:24:01 fgsch Exp $
--- c/dispatcher.c.orig Wed Dec 1 09:54:57 2004
+++ c/dispatcher.c Wed Jun 8 18:30:34 2005
@@ -3,6 +3,7 @@
#include "mergepoints.h"
#include "blockalloc.h"
#include "Python/pycompiler.h" /* for pyc_data_xxx() */
+#include "Objects/pobject.h" /* for Psyco_SafelyDeleteVar() */
#include <idispatcher.h>
@@ -1374,6 +1375,7 @@ void psyco_delete_unused_vars(PsycoObjec
for (i=0; i<limit; i++)
{
int num;
+ vinfo_t* vi;
PyObject* o1 = PyList_GET_ITEM(plist, i);
if (!PyInt_Check(o1))
break;
@@ -1382,8 +1384,9 @@ void psyco_delete_unused_vars(PsycoObjec
/* note that if psyco_delete_unused_vars() is called by
psyco_compile_code(), before any buffer is allocated,
it may not emit any code. */
- vinfo_decref(LOC_LOCALS_PLUS[num], po);
- LOC_LOCALS_PLUS[num] = psyco_vi_Zero();
+ vi = LOC_LOCALS_PLUS[num];
+ LOC_LOCALS_PLUS[num] = Psyco_SafelyDeleteVar(po, vi);
+ vinfo_decref(vi, po);
}
}

View File

@ -1,7 +1,5 @@
@comment $OpenBSD: PLIST,v 1.2 2005/01/17 19:36:44 fgsch Exp $
@comment $OpenBSD: PLIST,v 1.3 2006/09/21 14:41:50 fgsch Exp $
%%SHARED%%
lib/python${MODPY_VERSION}/
lib/python${MODPY_VERSION}/site-packages/
lib/python${MODPY_VERSION}/site-packages/psyco/
lib/python${MODPY_VERSION}/site-packages/psyco/__init__.py
lib/python${MODPY_VERSION}/site-packages/psyco/__init__.pyc