emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs/src ChangeLog lisp.h


From: Stefan Monnier
Subject: [Emacs-diffs] emacs/src ChangeLog lisp.h
Date: Tue, 03 Nov 2009 15:30:42 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Stefan Monnier <monnier>        09/11/03 15:30:41

Modified files:
        src            : ChangeLog lisp.h 

Log message:
        Make USE_LSB_TAG work with USE_LISP_UNION_TYPE.
        (P_): Support for prototypes is now required.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/src/ChangeLog?cvsroot=emacs&r1=1.7833&r2=1.7834
http://cvs.savannah.gnu.org/viewcvs/emacs/src/lisp.h?cvsroot=emacs&r1=1.670&r2=1.671

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/src/ChangeLog,v
retrieving revision 1.7833
retrieving revision 1.7834
diff -u -b -r1.7833 -r1.7834
--- ChangeLog   31 Oct 2009 17:12:13 -0000      1.7833
+++ ChangeLog   3 Nov 2009 15:30:39 -0000       1.7834
@@ -1,3 +1,8 @@
+2009-11-03  Stefan Monnier  <address@hidden>
+
+       * lisp.h: Make USE_LSB_TAG work with USE_LISP_UNION_TYPE.
+       (P_): Support for prototypes is now required.
+
 2009-10-31  Chong Yidong  <address@hidden>
 
        * frame.c (Fmake_frame_invisible, Fframe_visible_p): Doc fix

Index: lisp.h
===================================================================
RCS file: /sources/emacs/emacs/src/lisp.h,v
retrieving revision 1.670
retrieving revision 1.671
diff -u -b -r1.670 -r1.671
--- lisp.h      24 Oct 2009 16:32:08 -0000      1.670
+++ lisp.h      3 Nov 2009 15:30:41 -0000       1.671
@@ -22,11 +22,7 @@
 #define EMACS_LISP_H
 
 /* Declare the prototype for a general external function.  */
-#if defined (PROTOTYPES) || defined (WINDOWSNT)
 #define P_(proto) proto
-#else
-#define P_(proto) ()
-#endif
 
 /* Use the configure flag --enable-checking[=LIST] to enable various
    types of run time checks for Lisp objects.  */
@@ -139,11 +135,8 @@
 #if defined GNU_MALLOC || defined DOUG_LEA_MALLOC || defined __GLIBC__ || 
defined DARWIN_OS
 /* We also need to be able to specify mult-of-8 alignment on static vars.  */
 # if defined DECL_ALIGN
-/* We currently do not support USE_LSB_TAG with a union Lisp_Object.  */
-#  ifndef USE_LISP_UNION_TYPE
 #   define USE_LSB_TAG
 #  endif
-# endif
 #endif
 
 /* If we cannot use 8-byte alignment, make DECL_ALIGN a no-op.  */
@@ -367,12 +360,6 @@
      (var) = ((EMACS_INT) (type)) | ((EMACS_INT) (ptr)))
 #define make_number(N) (((EMACS_INT) (N)) << GCTYPEBITS)
 
-/* XFASTINT and XSETFASTINT are for use when the integer is known to be
-   positive, in which case the implementation can sometimes be faster
-   depending on the tagging scheme.  With USE_LSB_TAG, there's no benefit.  */
-#define XFASTINT(a) XINT (a)
-#define XSETFASTINT(a, b) ((a) = make_number (b))
-
 #define XPNTR(a) ((EMACS_INT) ((a) & ~TYPEMASK))
 
 #else  /* not USE_LSB_TAG */
@@ -423,12 +410,6 @@
 
 #define XTYPE(a) ((enum Lisp_Type) (a).u.type)
 
-/* For integers known to be positive, XFASTINT provides fast retrieval
-   and XSETFASTINT provides fast storage.  This takes advantage of the
-   fact that Lisp_Int is 0.  */
-#define XFASTINT(a) ((a).i + 0)
-#define XSETFASTINT(a, b) ((a).i = (b))
-
 #ifdef EXPLICIT_SIGN_EXTEND
 /* Make sure we sign-extend; compilers have been known to fail to do so.  */
 #define XINT(a) (((a).s.val << (BITS_PER_EMACS_INT - VALBITS)) \
@@ -439,9 +420,28 @@
 
 #define XUINT(a) ((a).u.val)
 
-#define XSET(var, vartype, ptr) \
+#ifdef USE_LSB_TAG
+
+# define XSET(var, vartype, ptr) \
+  (eassert ((((EMACS_UINT) (ptr)) & ((1 << GCTYPEBITS) - 1)) == 0),    \
+   (var).u.val = ((EMACS_UINT) (ptr)) >> GCTYPEBITS,                   \
+   (var).u.type = ((char) (vartype)))
+
+# define XPNTR(v) (((v).s.val) << GCTYPEBITS)
+
+#else  /* !USE_LSB_TAG */
+
+/* For integers known to be positive, XFASTINT provides fast retrieval
+   and XSETFASTINT provides fast storage.  This takes advantage of the
+   fact that Lisp_Int is 0.  */
+# define XFASTINT(a) ((a).i + 0)
+# define XSETFASTINT(a, b) ((a).i = (b))
+
+# define XSET(var, vartype, ptr) \
    (((var).s.val = ((EMACS_INT) (ptr))), ((var).s.type = ((char) (vartype))))
 
+#endif /* !USE_LSB_TAG */
+
 #if __GNUC__ >= 2 && defined (__OPTIMIZE__)
 #define make_number(N) \
   (__extension__ ({ Lisp_Object _l; _l.s.val = (N); _l.s.type = Lisp_Int; _l; 
}))
@@ -451,6 +451,14 @@
 
 #endif /* USE_LISP_UNION_TYPE */
 
+/* For integers known to be positive, XFASTINT sometimes provides
+   faster retrieval and XSETFASTINT provides faster storage.
+   If not, fallback on the non-accelerated path.  */
+#ifndef XFASTINT
+# define XFASTINT(a) (XINT (a))
+# define XSETFASTINT(a, b) (XSETINT (a, b))
+#endif
+
 #define EQ(x, y) (XHASH (x) == XHASH (y))
 
 #ifndef XPNTR




reply via email to

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