guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] GNU Guile branch, master, updated. release_1-9-8-73-gb7e


From: Ludovic Courtès
Subject: [Guile-commits] GNU Guile branch, master, updated. release_1-9-8-73-gb7ecadc
Date: Thu, 04 Mar 2010 23:42:52 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=b7ecadca7b84a5c9229001354f7b902ef94b5ac5

The branch, master has been updated
       via  b7ecadca7b84a5c9229001354f7b902ef94b5ac5 (commit)
       via  83a7171bf369d67a5cbb48568ba9727600e72a11 (commit)
      from  eddd16d782343fbc10818e4f2ee706774921f051 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit b7ecadca7b84a5c9229001354f7b902ef94b5ac5
Author: Ludovic Courtès <address@hidden>
Date:   Fri Mar 5 00:20:18 2010 +0100

    Slightly optimize the memoizer, bootstrap evaluator, and `(ice-9 eval)'.
    
    * libguile/eval.c (CAR, CDR, CAAR, CADR, CDAR, CDDR, CADDR, CDDDR): Use
      the macro variants, not the functions.
      (eval)[SCM_M_CALL]: When invoking a VM program, accumulate its
      arguments on the stack rather than on the heap.
    
    * libguile/memoize.c (CAR, CDR, CAAR, CADR, CDAR, CDDR, CADDR, CDDDR,
      CADDR): Use the macro variants, not the functions.
      (scm_memoized_expression_typecode): Use `SCM_I_MAKINUM' instead of
      `scm_from_uint16'.

commit 83a7171bf369d67a5cbb48568ba9727600e72a11
Author: Ludovic Courtès <address@hidden>
Date:   Thu Mar 4 23:28:38 2010 +0100

    Remove obsolete compile-time option for freelist debugging.
    
    * configure.ac: Remove `--enable-debug-freelist' option and
      `SCM_I_GSC_GUILE_DEBUG_FREELIST' substitution variable.
    
    * libguile/gen-scmconfig.c (main): Remove references to
      `SCM_I_GSC_GUILE_DEBUG_FREELIST' and `GUILE_DEBUG_FREELIST'.
    
    * libguile/gen-scmconfig.h.in (SCM_I_GSC_GUILE_DEBUG_FREELIST): Remove.

-----------------------------------------------------------------------

Summary of changes:
 configure.ac                |    9 ---------
 libguile/eval.c             |   40 +++++++++++++++++++++-------------------
 libguile/gen-scmconfig.c    |    8 --------
 libguile/gen-scmconfig.h.in |    1 -
 libguile/memoize.c          |   18 ++++--------------
 5 files changed, 25 insertions(+), 51 deletions(-)

diff --git a/configure.ac b/configure.ac
index e2699b4..909d6d3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -105,14 +105,6 @@ AC_ARG_ENABLE(error-on-warning,
      *) AC_MSG_ERROR(bad value ${enableval} for --enable-error-on-warning) ;;
    esac])
 
-SCM_I_GSC_GUILE_DEBUG_FREELIST=0
-AC_ARG_ENABLE(debug-freelist,
-  [  --enable-debug-freelist include garbage collector freelist debugging 
code],
-  if test "$enable_debug_freelist" = y \
-     || test "$enable_debug_freelist" = yes; then
-    SCM_I_GSC_GUILE_DEBUG_FREELIST=1
-  fi)
-
 AC_ARG_ENABLE(debug-malloc,
   [  --enable-debug-malloc   include malloc debugging code],
   if test "$enable_debug_malloc" = y || test "$enable_debug_malloc" = yes; then
@@ -1625,7 +1617,6 @@ AC_SUBST([sitedir])
 
 # Additional SCM_I_GSC definitions are above.
 AC_SUBST([SCM_I_GSC_GUILE_DEBUG])
-AC_SUBST([SCM_I_GSC_GUILE_DEBUG_FREELIST])
 AC_SUBST([SCM_I_GSC_ENABLE_DISCOURAGED])
 AC_SUBST([SCM_I_GSC_ENABLE_DEPRECATED])
 AC_SUBST([SCM_I_GSC_ENABLE_ELISP])
diff --git a/libguile/eval.c b/libguile/eval.c
index ba358a7..72ab774 100644
--- a/libguile/eval.c
+++ b/libguile/eval.c
@@ -24,6 +24,7 @@
 #endif
 
 #include <alloca.h>
+#include <assert.h>
 
 #include "libguile/__scm.h"
 
@@ -112,7 +113,6 @@ static scm_t_bits scm_tc16_boot_closure;
 
 
 
-#if 0
 #define CAR(x)   SCM_CAR(x)
 #define CDR(x)   SCM_CDR(x)
 #define CAAR(x)  SCM_CAAR(x)
@@ -121,16 +121,6 @@ static scm_t_bits scm_tc16_boot_closure;
 #define CDDR(x)  SCM_CDDR(x)
 #define CADDR(x) SCM_CADDR(x)
 #define CDDDR(x) SCM_CDDDR(x)
-#else
-#define CAR(x)   scm_car(x)
-#define CDR(x)   scm_cdr(x)
-#define CAAR(x)  scm_caar(x)
-#define CADR(x)  scm_cadr(x)
-#define CDAR(x)  scm_cdar(x)
-#define CDDR(x)  scm_cddr(x)
-#define CADDR(x) scm_caddr(x)
-#define CDDDR(x) scm_cdddr(x)
-#endif
 
 
 SCM_SYMBOL (scm_unbound_variable_key, "unbound-variable");
@@ -173,6 +163,7 @@ eval (SCM x, SCM env)
 {
   SCM mx;
   SCM proc = SCM_UNDEFINED, args = SCM_EOL;
+  unsigned int argc;
 
  loop:
   SCM_TICK;
@@ -290,7 +281,7 @@ eval (SCM x, SCM env)
     case SCM_M_CALL:
       /* Evaluate the procedure to be applied.  */
       proc = eval (CAR (mx), env);
-      /* int nargs = CADR (mx); */
+      argc = SCM_I_INUM (CADR (mx));
       mx = CDDR (mx);
 
       if (BOOT_CLOSURE_P (proc))
@@ -299,7 +290,7 @@ eval (SCM x, SCM env)
           SCM new_env = BOOT_CLOSURE_ENV (proc);
           if (BOOT_CLOSURE_HAS_REST_ARGS (proc))
             {
-              if (SCM_UNLIKELY (scm_ilength (mx) < nreq))
+              if (SCM_UNLIKELY (argc < nreq))
                 scm_wrong_num_args (proc);
               for (; nreq; nreq--, mx = CDR (mx))
                 new_env = scm_cons (eval (CAR (mx), env), new_env);
@@ -324,13 +315,24 @@ eval (SCM x, SCM env)
         }
       else
         {
-          SCM rest = SCM_EOL;
-          /* FIXME: use alloca */
-          for (; scm_is_pair (mx); mx = CDR (mx))
-            rest = scm_cons (eval (CAR (mx), env), rest);
-          return scm_vm_apply (scm_the_vm (), proc, scm_reverse (rest));
+         unsigned int i;
+
+         /* Using `alloca' would make the stack grow until this function
+            returns.  Thus we use C99 variable-length arrays where available,
+            so that stack space is freed when ARGV goes out of scope.  */
+#if __STDC_VERSION__ >= 199901L
+         SCM argv[argc];
+#else
+         SCM argv[128];
+         assert (argc < 128);
+#endif
+
+         for (i = 0; i < argc; i++, mx = CDR (mx))
+           argv[i] = eval (CAR (mx), env);
+
+         return scm_c_vm_run (scm_the_vm (), proc, argv, argc);
         }
-          
+
     case SCM_M_CONT:
       return scm_i_call_with_current_continuation (eval (mx, env));
 
diff --git a/libguile/gen-scmconfig.c b/libguile/gen-scmconfig.c
index cf5f6c7..c1d6aad 100644
--- a/libguile/gen-scmconfig.c
+++ b/libguile/gen-scmconfig.c
@@ -219,14 +219,6 @@ main (int argc, char *argv[])
     pf ("#define GUILE_DEBUG 1 /* defined or undefined */\n");
   else
     pf ("/* #undef GUILE_DEBUG */\n");
-  
-  /*** GUILE_DEBUG_FREELIST (deined or undefined) ***/
-  pf ("\n");
-  pf ("/* Define this to debug the free list (helps w/ GC bugs). */\n");
-  if (SCM_I_GSC_GUILE_DEBUG_FREELIST)
-    pf ("#define GUILE_DEBUG_FREELIST 1 /* defined or undefined */\n");
-  else
-    pf ("/* #undef GUILE_DEBUG_FREELIST */\n");
 
   /*** SCM_ENABLE_DISCOURAGED (0 or 1) ***/
   pf ("\n");
diff --git a/libguile/gen-scmconfig.h.in b/libguile/gen-scmconfig.h.in
index 5d569f6..f36fb09 100644
--- a/libguile/gen-scmconfig.h.in
+++ b/libguile/gen-scmconfig.h.in
@@ -7,7 +7,6 @@
 */
 
 #define SCM_I_GSC_GUILE_DEBUG @SCM_I_GSC_GUILE_DEBUG@
-#define SCM_I_GSC_GUILE_DEBUG_FREELIST @SCM_I_GSC_GUILE_DEBUG_FREELIST@
 #define SCM_I_GSC_ENABLE_DISCOURAGED @SCM_I_GSC_ENABLE_DISCOURAGED@
 #define SCM_I_GSC_ENABLE_DEPRECATED @SCM_I_GSC_ENABLE_DEPRECATED@
 #define SCM_I_GSC_ENABLE_ELISP @SCM_I_GSC_ENABLE_ELISP@
diff --git a/libguile/memoize.c b/libguile/memoize.c
index e2fcfee..0427cea 100644
--- a/libguile/memoize.c
+++ b/libguile/memoize.c
@@ -42,7 +42,6 @@
 
 
 
-#if 0
 #define CAR(x)   SCM_CAR(x)
 #define CDR(x)   SCM_CDR(x)
 #define CAAR(x)  SCM_CAAR(x)
@@ -51,18 +50,7 @@
 #define CDDR(x)  SCM_CDDR(x)
 #define CADDR(x) SCM_CADDR(x)
 #define CDDDR(x) SCM_CDDDR(x)
-#define CADDDR(x) SCM_CDDDR(x)
-#else
-#define CAR(x)   scm_car(x)
-#define CDR(x)   scm_cdr(x)
-#define CAAR(x)  scm_caar(x)
-#define CADR(x)  scm_cadr(x)
-#define CDAR(x)  scm_cdar(x)
-#define CDDR(x)  scm_cddr(x)
-#define CADDR(x) scm_caddr(x)
-#define CDDDR(x) scm_cdddr(x)
-#define CADDDR(x) scm_cadddr(x)
-#endif
+#define CADDDR(x) SCM_CADDDR(x)
 
 
 static const char s_bad_expression[] = "Bad expression";
@@ -1211,7 +1199,9 @@ SCM_DEFINE (scm_memoized_expression_typecode, 
"memoized-expression-typecode", 1,
 #define FUNC_NAME s_scm_memoized_expression_typecode
 {
   SCM_VALIDATE_MEMOIZED (1, m);
-  return scm_from_uint16 (SCM_MEMOIZED_TAG (m));
+
+  /* The tag is a 16-bit integer so it fits in an inum.  */
+  return SCM_I_MAKINUM (SCM_MEMOIZED_TAG (m));
 }
 #undef FUNC_NAME
 


hooks/post-receive
-- 
GNU Guile




reply via email to

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