CVS update by aidan xemacs/src ...

xemacs-cvs at xemacs.org xemacs-cvs at xemacs.org
Sat May 26 15:00:27 EDT 2007


  User: aidan   
  Date: 07/05/26 21:00:27

  Modified:    xemacs/src ChangeLog eval.c
Log:
Small speed improvement to eval, from Sebastian Freundt.

Revision  Changes    Path
1.1069    +8 -0      XEmacs/xemacs/src/ChangeLog

Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ChangeLog,v
retrieving revision 1.1068
retrieving revision 1.1069
diff -u -p -r1.1068 -r1.1069
--- ChangeLog	2007/05/26 18:28:19	1.1068
+++ ChangeLog	2007/05/26 19:00:16	1.1069
@@ -1,5 +1,13 @@
 2007-05-24  Aidan Kehoe  <kehoea at parhasard.net>
 
+	* eval.c (Feval):
+	Small optimisations from Sebastian Freundt's SXEmacs work; don't
+	do the unnecessary book-keeping in the trivial cases, only look
+	for an indirect function if the stored function is a bound
+	symbol. 
+
+2007-05-24  Aidan Kehoe  <kehoea at parhasard.net>
+
 	* free-hook.c (check_free):
 	* lisp.h:
 	* lisp.h (xfree):



1.96      +17 -9     XEmacs/xemacs/src/eval.c

Index: eval.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/eval.c,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -p -r1.95 -r1.96
--- eval.c	2007/02/22 16:53:26	1.95
+++ eval.c	2007/05/26 19:00:20	1.96
@@ -3539,6 +3539,16 @@ Evaluate FORM and return its value.
   check_proper_critical_section_lisp_protection ();
 #endif
 
+  if (!CONSP (form))
+    {
+      if (SYMBOLP (form))
+        {
+          return Fsymbol_value (form);
+        }
+
+      return form;
+    }
+
   /* I think this is a pretty safe place to call Lisp code, don't you? */
   while (!in_warnings && !NILP (Vpending_warnings)
 	 /* well, perhaps not so safe after all! */
@@ -3571,14 +3581,6 @@ Evaluate FORM and return its value.
       unbind_to (speccount);
     }
 
-  if (!CONSP (form))
-    {
-      if (SYMBOLP (form))
-	return Fsymbol_value (form);
-      else
-	return form;
-    }
-
   QUIT;
   if (need_to_garbage_collect)
     {
@@ -3622,7 +3624,13 @@ Evaluate FORM and return its value.
   /* At this point, only original_fun and original_args
      have values that will be used below. */
  retry:
-  fun = indirect_function (original_fun, 1);
+  /* Optimise for no indirection.  */
+  fun = original_fun;
+  if (SYMBOLP (fun) && !EQ (fun, Qunbound)
+      && (fun = XSYMBOL (fun)->function, SYMBOLP (fun)))
+    {
+      fun = indirect_function(original_fun, 1);
+    }
 
   if (SUBRP (fun))
     {





More information about the XEmacs-CVS mailing list