guile-cvs
[Top][All Lists]
Advanced

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

guile/guile-core doc/ChangeLog doc/gh.texi ice-...


From: Neil Jerram
Subject: guile/guile-core doc/ChangeLog doc/gh.texi ice-...
Date: Tue, 26 Jun 2001 14:55:45 -0700

CVSROOT:        /cvs
Module name:    guile
Changes by:     Neil Jerram <address@hidden>    01/06/26 14:55:45

Modified files:
        guile-core/doc : ChangeLog gh.texi 
        guile-core/ice-9: ChangeLog boot-9.scm debug.scm 
        guile-core/libguile: ChangeLog debug.h eval.c eval.h 

Log message:
        * Handle evaluator traps by calling trap handlers directly rather than
        by scm_ithrow and a lazy catch handler.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/doc/ChangeLog.diff?cvsroot=OldCVS&tr1=1.102&tr2=1.103&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/doc/gh.texi.diff?cvsroot=OldCVS&tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/ice-9/ChangeLog.diff?cvsroot=OldCVS&tr1=1.455&tr2=1.456&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/ice-9/boot-9.scm.diff?cvsroot=OldCVS&tr1=1.264&tr2=1.265&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/ice-9/debug.scm.diff?cvsroot=OldCVS&tr1=1.21&tr2=1.22&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/libguile/ChangeLog.diff?cvsroot=OldCVS&tr1=1.1453&tr2=1.1454&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/libguile/debug.h.diff?cvsroot=OldCVS&tr1=1.40&tr2=1.41&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/libguile/eval.c.diff?cvsroot=OldCVS&tr1=1.232&tr2=1.233&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/libguile/eval.h.diff?cvsroot=OldCVS&tr1=1.59&tr2=1.60&r1=text&r2=text

Patches:
Index: guile/guile-core/doc/ChangeLog
diff -u guile/guile-core/doc/ChangeLog:1.102 
guile/guile-core/doc/ChangeLog:1.103
--- guile/guile-core/doc/ChangeLog:1.102        Tue Jun 26 03:59:34 2001
+++ guile/guile-core/doc/ChangeLog      Tue Jun 26 14:55:44 2001
@@ -1,3 +1,8 @@
+2001-06-26  Neil Jerram  <address@hidden>
+
+       * gh.texi (scm transition summary): Refer to scm_mem2string
+       instead of scm_makfromstr.
+
 2001-06-26  Dirk Herrmann  <address@hidden>
 
        * oldfmt.c (scm_oldfmt):  Use scm_mem2string instead of
Index: guile/guile-core/doc/gh.texi
diff -u guile/guile-core/doc/gh.texi:1.7 guile/guile-core/doc/gh.texi:1.8
--- guile/guile-core/doc/gh.texi:1.7    Mon Jun 25 15:27:11 2001
+++ guile/guile-core/doc/gh.texi        Tue Jun 26 14:55:44 2001
@@ -901,9 +901,7 @@
 Use @code{SCM_MAKE_CHAR} instead.
 
 @item @code{gh_str2scm}
-Use @code{scm_makfromstr} instead.  Note that @code{scm_makfromstr}
-currently has an additional, third parameter, but it's unused and will
-hopefully disappear soon.  If it's still there, set it to 0.
+Use @code{scm_mem2string} instead.
 
 @item @code{gh_str02scm}
 Use @code{scm_makfrom0str} instead.
Index: guile/guile-core/ice-9/ChangeLog
diff -u guile/guile-core/ice-9/ChangeLog:1.455 
guile/guile-core/ice-9/ChangeLog:1.456
--- guile/guile-core/ice-9/ChangeLog:1.455      Sun Jun 24 20:27:51 2001
+++ guile/guile-core/ice-9/ChangeLog    Tue Jun 26 14:55:45 2001
@@ -1,3 +1,12 @@
+2001-06-26  Neil Jerram  <address@hidden>
+
+       * debug.scm (trace): Set evaluator trap options to handle tracing.
+       Don't reset trace-level to 0.
+       
+       * boot-9.scm (lazy-handler-dispatch): Remove enter-frame-handler,
+       apply-frame-handler and exit-frame-handler.  (They're replaced by
+       evaluator trap options.)
+
 2001-06-25  Michael Livshin  <address@hidden>
 
        * streams.scm (stream-for-each-many): typo fix.
Index: guile/guile-core/ice-9/boot-9.scm
diff -u guile/guile-core/ice-9/boot-9.scm:1.264 
guile/guile-core/ice-9/boot-9.scm:1.265
--- guile/guile-core/ice-9/boot-9.scm:1.264     Sun Jun 24 18:06:33 2001
+++ guile/guile-core/ice-9/boot-9.scm   Tue Jun 26 14:55:45 2001
@@ -2237,20 +2237,8 @@
   (save-stack lazy-handler-dispatch)
   (apply throw key args))
 
-(define enter-frame-handler default-lazy-handler)
-(define apply-frame-handler default-lazy-handler)
-(define exit-frame-handler default-lazy-handler)
-
 (define (lazy-handler-dispatch key . args)
-  (case key
-    ((apply-frame)
-     (apply apply-frame-handler key args))
-    ((exit-frame)
-     (apply exit-frame-handler key args))
-    ((enter-frame)
-     (apply enter-frame-handler key args))
-    (else
-     (apply default-lazy-handler key args))))
+  (apply default-lazy-handler key args))
 
 (define abort-hook (make-hook))
 
Index: guile/guile-core/ice-9/debug.scm
diff -u guile/guile-core/ice-9/debug.scm:1.21 
guile/guile-core/ice-9/debug.scm:1.22
--- guile/guile-core/ice-9/debug.scm:1.21       Sun Jun  3 16:29:45 2001
+++ guile/guile-core/ice-9/debug.scm    Tue Jun 26 14:55:45 2001
@@ -78,9 +78,12 @@
                        (set! traced-procedures
                              (cons proc traced-procedures))))
                  args)
-       (set! apply-frame-handler trace-entry)
-       (set! exit-frame-handler trace-exit)
-       (set! trace-level 0)
+       (trap-set! apply-frame-handler trace-entry)
+       (trap-set! exit-frame-handler trace-exit)
+       ;; We used to reset `trace-level' here to 0, but this is wrong
+       ;; if `trace' itself is being traced, since `trace-exit' will
+       ;; then decrement `trace-level' to -1!  It shouldn't actually
+       ;; be necessary to set `trace-level' here at all.
        (debug-enable 'trace)
        (nameify args))))
 
Index: guile/guile-core/libguile/ChangeLog
diff -u guile/guile-core/libguile/ChangeLog:1.1453 
guile/guile-core/libguile/ChangeLog:1.1454
--- guile/guile-core/libguile/ChangeLog:1.1453  Tue Jun 26 14:18:51 2001
+++ guile/guile-core/libguile/ChangeLog Tue Jun 26 14:55:45 2001
@@ -1,3 +1,18 @@
+2001-06-26  Neil Jerram  <address@hidden>
+
+       * eval.h, eval.c (scm_call_4): New function.
+
+       * eval.c (SCM_APPLY, SCM_CEVAL, ENTER_APPLY): Call trap handlers
+       directly rather than dispatching to them via scm_ithrow and a lazy
+       catch.
+       
+       * eval.c (scm_evaluator_trap_table), eval.h (SCM_ENTER_FRAME_HDLR,
+       SCM_APPLY_FRAME_HDLR, SCM_EXIT_FRAME_HDLR): Add three new options
+       for trap handler procedures.
+
+       * debug.h (SCM_RESET_DEBUG_MODE): Add checks for trap handler
+       procedures not being #f.
+
 2001-06-27  Michael Livshin  <address@hidden>
 
        * Makefile.am (c-tokenize.c): add rule to generate it.
Index: guile/guile-core/libguile/debug.h
diff -u guile/guile-core/libguile/debug.h:1.40 
guile/guile-core/libguile/debug.h:1.41
--- guile/guile-core/libguile/debug.h:1.40      Mon Jun 25 04:06:33 2001
+++ guile/guile-core/libguile/debug.h   Tue Jun 26 14:55:45 2001
@@ -98,13 +98,15 @@
 
 #define SCM_RESET_DEBUG_MODE \
 do {\
-  CHECK_ENTRY = SCM_ENTER_FRAME_P || SCM_BREAKPOINTS_P;\
-  CHECK_APPLY = SCM_APPLY_FRAME_P || SCM_TRACE_P;\
-  CHECK_EXIT = SCM_EXIT_FRAME_P || SCM_TRACE_P;\
+  CHECK_ENTRY = (SCM_ENTER_FRAME_P || SCM_BREAKPOINTS_P)\
+    && SCM_NFALSEP (SCM_ENTER_FRAME_HDLR);\
+  CHECK_APPLY = (SCM_APPLY_FRAME_P || SCM_TRACE_P)\
+    && SCM_NFALSEP (SCM_APPLY_FRAME_HDLR);\
+  CHECK_EXIT = (SCM_EXIT_FRAME_P || SCM_TRACE_P)\
+    && SCM_NFALSEP (SCM_EXIT_FRAME_HDLR);\
   scm_debug_mode = SCM_DEVAL_P || CHECK_ENTRY || CHECK_APPLY || CHECK_EXIT;\
   scm_ceval_ptr = scm_debug_mode ? scm_deval : scm_ceval;\
 } while (0)
-
 
 /* {Evaluator}
  */
Index: guile/guile-core/libguile/eval.c
diff -u guile/guile-core/libguile/eval.c:1.232 
guile/guile-core/libguile/eval.c:1.233
--- guile/guile-core/libguile/eval.c:1.232      Tue Jun 26 08:46:40 2001
+++ guile/guile-core/libguile/eval.c    Tue Jun 26 14:55:45 2001
@@ -1620,18 +1620,20 @@
       {\
        SCM tmp, tail = SCM_BOOL(SCM_TRACED_FRAME_P (debug)); \
        SCM_SET_TRACED_FRAME (debug); \
+       SCM_TRAPS_P = 0;\
        if (SCM_CHEAPTRAPS_P)\
          {\
            tmp = scm_make_debugobj (&debug);\
-           scm_ithrow (scm_sym_apply_frame, scm_cons2 (tmp, tail, SCM_EOL), 
0);\
+           scm_call_3 (SCM_APPLY_FRAME_HDLR, scm_sym_apply_frame, tmp, tail);\
          }\
        else\
          {\
             int first;\
            tmp = scm_make_continuation (&first);\
            if (first)\
-             scm_ithrow (scm_sym_apply_frame, scm_cons2 (tmp, tail, SCM_EOL), 
0);\
+             scm_call_3 (SCM_APPLY_FRAME_HDLR, scm_sym_apply_frame, tmp, 
tail);\
          }\
+       SCM_TRAPS_P = 1;\
       }\
 } while (0)
 #undef RETURN
@@ -1695,14 +1697,17 @@
   { SCM_OPTION_BOOLEAN, "backtrace", 0, "Show backtrace on error." },
   { SCM_OPTION_BOOLEAN, "debug", 0, "Use the debugging evaluator." },
   { SCM_OPTION_INTEGER, "stack", 20000, "Stack size limit (measured in words; 
0 = no check)." },
-  { SCM_OPTION_SCM, "show-file-name", SCM_BOOL_T, "Show file names and line 
numbers in backtraces when not `#f'.  A value of `base' displays only base 
names, while `#t' displays full names."}
+  { SCM_OPTION_SCM, "show-file-name", (unsigned long)SCM_BOOL_T, "Show file 
names and line numbers in backtraces when not `#f'.  A value of `base' displays 
only base names, while `#t' displays full names."}
 };
 
 scm_t_option scm_evaluator_trap_table[] = {
   { SCM_OPTION_BOOLEAN, "traps", 0, "Enable evaluator traps." },
   { SCM_OPTION_BOOLEAN, "enter-frame", 0, "Trap when eval enters new frame." },
   { SCM_OPTION_BOOLEAN, "apply-frame", 0, "Trap when entering apply." },
-  { SCM_OPTION_BOOLEAN, "exit-frame", 0, "Trap when exiting eval or apply." }
+  { SCM_OPTION_BOOLEAN, "exit-frame", 0, "Trap when exiting eval or apply." },
+  { SCM_OPTION_SCM, "enter-frame-handler", (unsigned long)SCM_BOOL_F, "Handler 
for enter-frame traps." },
+  { SCM_OPTION_SCM, "apply-frame-handler", (unsigned long)SCM_BOOL_F, "Handler 
for apply-frame traps." },
+  { SCM_OPTION_SCM, "exit-frame-handler", (unsigned long)SCM_BOOL_F, "Handler 
for exit-frame traps." }
 };
 
 SCM_DEFINE (scm_eval_options_interface, "eval-options-interface", 0, 1, 0, 
@@ -1914,10 +1919,13 @@
                  goto dispatch;
              }
          }
-       scm_ithrow (scm_sym_enter_frame,
-                   scm_cons2 (t.arg1, tail,
-                              scm_cons (scm_unmemocopy (x, env), SCM_EOL)),
-                   0);
+       SCM_TRAPS_P = 0;
+       scm_call_4 (SCM_ENTER_FRAME_HDLR,
+                   scm_sym_enter_frame,
+                   t.arg1,
+                   tail,
+                   scm_unmemocopy (x, env));
+       SCM_TRAPS_P = 1;
       }
 #endif
 #if defined (USE_THREADS) || defined (DEVAL)
@@ -3231,7 +3239,9 @@
                goto ret;
              }
          }
-       scm_ithrow (scm_sym_exit_frame, scm_cons2 (t.arg1, proc, SCM_EOL), 0);
+       SCM_TRAPS_P = 0;
+       scm_call_3 (SCM_EXIT_FRAME_HDLR, scm_sym_exit_frame, t.arg1, proc);
+       SCM_TRAPS_P = 1;
       }
 ret:
   scm_last_debug_frame = debug.prev;
@@ -3273,6 +3283,13 @@
   return scm_apply (proc, arg1, scm_cons2 (arg2, arg3, scm_listofnull));
 }
 
+SCM
+scm_call_4 (SCM proc, SCM arg1, SCM arg2, SCM arg3, SCM arg4)
+{
+  return scm_apply (proc, arg1, scm_cons2 (arg2, arg3,
+                                          scm_cons (arg4, scm_listofnull)));
+}
+
 /* Simple procedure applies
  */
 
@@ -3446,7 +3463,9 @@
          if (!first)
            goto entap;
        }
-      scm_ithrow (scm_sym_enter_frame, scm_cons (tmp, SCM_EOL), 0);
+      SCM_TRAPS_P = 0;
+      scm_call_2 (SCM_ENTER_FRAME_HDLR, scm_sym_enter_frame, tmp);
+      SCM_TRAPS_P = 1;
     }
 entap:
   ENTER_APPLY;
@@ -3676,7 +3695,9 @@
                goto ret;
              }
          }
-       scm_ithrow (scm_sym_exit_frame, scm_cons2 (arg1, proc, SCM_EOL), 0);
+       SCM_TRAPS_P = 0;
+       scm_call_3 (SCM_EXIT_FRAME_HDLR, scm_sym_exit_frame, arg1, proc);
+       SCM_TRAPS_P = 1;
       }
 ret:
   scm_last_debug_frame = debug.prev;
Index: guile/guile-core/libguile/eval.h
diff -u guile/guile-core/libguile/eval.h:1.59 
guile/guile-core/libguile/eval.h:1.60
--- guile/guile-core/libguile/eval.h:1.59       Tue Jun 26 08:46:40 2001
+++ guile/guile-core/libguile/eval.h    Tue Jun 26 14:55:45 2001
@@ -68,7 +68,10 @@
 #define SCM_ENTER_FRAME_P      scm_evaluator_trap_table[1].val
 #define SCM_APPLY_FRAME_P      scm_evaluator_trap_table[2].val
 #define SCM_EXIT_FRAME_P       scm_evaluator_trap_table[3].val
-#define SCM_N_EVALUATOR_TRAPS 4
+#define SCM_ENTER_FRAME_HDLR   (SCM)(scm_evaluator_trap_table[4].val)
+#define SCM_APPLY_FRAME_HDLR   (SCM)(scm_evaluator_trap_table[5].val)
+#define SCM_EXIT_FRAME_HDLR    (SCM)(scm_evaluator_trap_table[6].val)
+#define SCM_N_EVALUATOR_TRAPS 7
 
 
 
@@ -235,6 +238,7 @@
 extern SCM scm_call_1 (SCM proc, SCM arg1);
 extern SCM scm_call_2 (SCM proc, SCM arg1, SCM arg2);
 extern SCM scm_call_3 (SCM proc, SCM arg1, SCM arg2, SCM arg3);
+extern SCM scm_call_4 (SCM proc, SCM arg1, SCM arg2, SCM arg3, SCM arg4);
 extern SCM scm_apply_0 (SCM proc, SCM args);
 extern SCM scm_apply_1 (SCM proc, SCM arg1, SCM args);
 extern SCM scm_apply_2 (SCM proc, SCM arg1, SCM arg2, SCM args);



reply via email to

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