guile-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

guile/guile-core/libguile ChangeLog gsubr.c gsu...


From: Dirk Herrmann
Subject: guile/guile-core/libguile ChangeLog gsubr.c gsu...
Date: Tue, 26 Sep 2000 13:11:22 -0700

CVSROOT:        /cvs
Module name:    guile
Changes by:     Dirk Herrmann <address@hidden>  00/09/26 13:11:22

Modified files:
        guile-core/libguile: ChangeLog gsubr.c gsubr.h procs.c procs.h 

Log message:
        * Don't use string or vector macros when accessing compiled closures.

CVSWeb URLs:
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/libguile/ChangeLog.diff?r1=1.1122&r2=1.1123
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/libguile/gsubr.c.diff?r1=1.32&r2=1.33
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/libguile/gsubr.h.diff?r1=1.12&r2=1.13
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/libguile/procs.c.diff?r1=1.43&r2=1.44
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/libguile/procs.h.diff?r1=1.33&r2=1.34

Patches:
Index: guile/guile-core/libguile/ChangeLog
diff -u guile/guile-core/libguile/ChangeLog:1.1122 
guile/guile-core/libguile/ChangeLog:1.1123
--- guile/guile-core/libguile/ChangeLog:1.1122  Tue Sep 26 12:40:10 2000
+++ guile/guile-core/libguile/ChangeLog Tue Sep 26 13:11:22 2000
@@ -1,5 +1,21 @@
 2000-09-26  Dirk Herrmann  <address@hidden>
 
+       * procs.h (SCM_CCLO_LENGTH, SCM_SET_CCLO_LENGTH, SCM_CCLO_BASE,
+       SCM_SET_CCLO_BASE, SCM_CCLO_REF, SCM_CCLO_SET, SCM_CCLO_SUBR,
+       SCM_SET_CCLO_SUBR):  Added resp. changed such that none of the
+       macros SCM_CHARS, SCM_SETCHARS, SCM_VELTS and SCM_LENGTH have to
+       be used with compiled closures any more.
+
+       * procs.c (scm_makcclo), gsubr.h (SCM_GSUBR_TYPE, SCM_GSUBR_PROC):
+       Replace uses of SCM_CHARS, SCM_SETCHARS and SCM_VELTS with regards
+       to compiled closures.
+
+       * gsubr.h (SCM_SET_GSUBR_TYPE, SCM_SET_GSUBR_PROC):  Added.
+
+       * gsubr.c (scm_make_gsubr):  Use them.
+
+2000-09-26  Dirk Herrmann  <address@hidden>
+
        * numbers.c (scm_adjbig):  Use SCM_BDIGITS instead of SCM_CHARS.
 
        (big2str, scm_bigprint):  Use SCM_STRING_CHARS instead of
Index: guile/guile-core/libguile/gsubr.c
diff -u guile/guile-core/libguile/gsubr.c:1.32 
guile/guile-core/libguile/gsubr.c:1.33
--- guile/guile-core/libguile/gsubr.c:1.32      Mon Jun 12 05:28:23 2000
+++ guile/guile-core/libguile/gsubr.c   Tue Sep 26 13:11:22 2000
@@ -83,8 +83,8 @@
        fputs("ERROR in scm_make_gsubr: too many args\n", stderr);
        exit (1);
       }
-      SCM_GSUBR_PROC (cclo) = scm_make_subr_opt (name, scm_tc7_subr_0, fcn, 0);
-      SCM_GSUBR_TYPE (cclo) = SCM_MAKINUM (SCM_GSUBR_MAKTYPE (req, opt, rst));
+      SCM_SET_GSUBR_PROC (cclo, scm_make_subr_opt (name, scm_tc7_subr_0, fcn, 
0));
+      SCM_SET_GSUBR_TYPE (cclo, SCM_MAKINUM (SCM_GSUBR_MAKTYPE (req, opt, 
rst)));
       SCM_SETCDR (symcell, cclo);
 #ifdef DEBUG_EXTENSIONS
       if (SCM_REC_PROCNAMES_P)
Index: guile/guile-core/libguile/gsubr.h
diff -u guile/guile-core/libguile/gsubr.h:1.12 
guile/guile-core/libguile/gsubr.h:1.13
--- guile/guile-core/libguile/gsubr.h:1.12      Mon Jun 12 05:28:23 2000
+++ guile/guile-core/libguile/gsubr.h   Tue Sep 26 13:11:22 2000
@@ -54,8 +54,10 @@
 #define SCM_GSUBR_REST(x) ((int)(x)>>8)
 
 #define SCM_GSUBR_MAX 10
-#define SCM_GSUBR_TYPE(cclo) (SCM_VELTS(cclo)[1])
-#define SCM_GSUBR_PROC(cclo) (SCM_VELTS(cclo)[2])
+#define SCM_GSUBR_TYPE(cclo) (SCM_CCLO_REF ((cclo), 1))
+#define SCM_SET_GSUBR_TYPE(cclo, type) (SCM_CCLO_SET ((cclo), 1, (type)))
+#define SCM_GSUBR_PROC(cclo) (SCM_CCLO_REF ((cclo), 2))
+#define SCM_SET_GSUBR_PROC(cclo, proc) (SCM_CCLO_SET ((cclo), 2, (proc)))
 
 extern SCM scm_f_gsubr_apply;
 
Index: guile/guile-core/libguile/procs.c
diff -u guile/guile-core/libguile/procs.c:1.43 
guile/guile-core/libguile/procs.c:1.44
--- guile/guile-core/libguile/procs.c:1.43      Thu Aug 24 19:26:22 2000
+++ guile/guile-core/libguile/procs.c   Tue Sep 26 13:11:22 2000
@@ -153,14 +153,18 @@
 SCM 
 scm_makcclo (SCM proc, long len)
 {
+  scm_bits_t *base = scm_must_malloc (len * sizeof (scm_bits_t), 
"compiled-closure");
+  unsigned long i;
   SCM s;
+
+  for (i = 0; i < len; ++i)
+    base [i] = SCM_UNPACK (SCM_UNSPECIFIED);
+
   SCM_NEWCELL (s);
   SCM_DEFER_INTS;
-  SCM_SETCHARS (s, scm_must_malloc (len * sizeof (SCM), "compiled-closure"));
-  SCM_SETLENGTH (s, len, scm_tc7_cclo);
-  while (--len)
-    SCM_VELTS (s)[len] = SCM_UNSPECIFIED;
-  SCM_CCLO_SUBR (s) = proc;
+  SCM_SET_CCLO_BASE (s, base);
+  SCM_SET_CCLO_LENGTH (s, len);
+  SCM_SET_CCLO_SUBR (s, proc);
   SCM_ALLOW_INTS;
   return s;
 }
Index: guile/guile-core/libguile/procs.h
diff -u guile/guile-core/libguile/procs.h:1.33 
guile/guile-core/libguile/procs.h:1.34
--- guile/guile-core/libguile/procs.h:1.33      Mon Jun  5 05:54:40 2000
+++ guile/guile-core/libguile/procs.h   Tue Sep 26 13:11:22 2000
@@ -74,7 +74,17 @@
 #define SCM_SUBRF(x) ((SCM (*)()) SCM_CELL_WORD_1 (x))
 #define SCM_SET_SUBRF(x, v) (SCM_SET_CELL_WORD_1 ((x), (v)))
 #define SCM_DSUBRF(x) ((double (*)()) SCM_CELL_WORD_1 (x))
-#define SCM_CCLO_SUBR(x) (SCM_VELTS(x)[0])
+
+#define SCM_CCLO_LENGTH(x) (SCM_CELL_WORD_0 (x) >> 8)
+#define SCM_SET_CCLO_LENGTH(x, v) (SCM_SET_CELL_WORD_0 ((x), ((v) << 8) + 
scm_tc7_cclo))
+#define SCM_CCLO_BASE(x) ((scm_bits_t *) SCM_CELL_WORD_1 (x))
+#define SCM_SET_CCLO_BASE(x, v) (SCM_SET_CELL_WORD_1 ((x), (v)))
+
+#define SCM_CCLO_REF(x, i) (SCM_PACK (SCM_CCLO_BASE (x) [i]))
+#define SCM_CCLO_SET(x, i, v) (SCM_CCLO_BASE (x) [i] = SCM_UNPACK (v))
+
+#define SCM_CCLO_SUBR(x) (SCM_CCLO_REF ((x), 0))
+#define SCM_SET_CCLO_SUBR(x, v) (SCM_CCLO_SET ((x), 0, (v)))
 
 #define SCM_SUBR_GENERIC(x) (SCM_SUBR_ENTRY (x).generic)
 #define SCM_SUBR_PROPS(x) (SCM_SUBR_ENTRY (x).properties)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]