]> git.eshelyaron.com Git - emacs.git/commitdiff
Simplify and speed up EQ again
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 13 Feb 2024 17:54:51 +0000 (09:54 -0800)
committerEshel Yaron <me@eshelyaron.com>
Wed, 14 Feb 2024 08:15:21 +0000 (09:15 +0100)
* src/lisp.h (lisp_h_BASE2_EQ, lisp_h_EQ): Simplify and refactor.
On x86-64 with GCC 3.2 this shrinks temacs text by 0.055% and
after removing all *.elc files speeds up 'make' by 1.0%.

(cherry picked from commit 08c1863257469b4cb85e97a276ba635d44b22666)

src/lisp.h

index f6133669ac155e2a9c5e979f1fd7d455685d703f..b609bef990c535ca4b1fa25d98aaf5522da7ed5c 100644 (file)
@@ -385,18 +385,13 @@ typedef EMACS_INT Lisp_Word;
 #define lisp_h_CONSP(x) TAGGEDP (x, Lisp_Cons)
 #define lisp_h_BASE_EQ(x, y) (XLI (x) == XLI (y))
 #define lisp_h_BASE2_EQ(x, y) \
-  (symbols_with_pos_enabled \
-   ? BASE_EQ (SYMBOL_WITH_POS_P (x) ? XSYMBOL_WITH_POS (x)->sym : (x), y) \
-   : BASE_EQ (x, y))
-
-/* FIXME: Do we really need to inline the whole thing?
- * What about keeping the part after `symbols_with_pos_enabled` in
- * a separate function?  */
+  BASE_EQ ((symbols_with_pos_enabled && SYMBOL_WITH_POS_P (x) \
+           ? XSYMBOL_WITH_POS (x)->sym : (x)), \
+          y)
 #define lisp_h_EQ(x, y) \
-  (symbols_with_pos_enabled \
-   ? BASE_EQ (SYMBOL_WITH_POS_P (x) ? XSYMBOL_WITH_POS (x)->sym : (x), \
-             SYMBOL_WITH_POS_P (y) ? XSYMBOL_WITH_POS (y)->sym : (y)) \
-   : BASE_EQ (x, y))
+  BASE2_EQ (x, \
+           (symbols_with_pos_enabled && SYMBOL_WITH_POS_P (y) \
+            ? XSYMBOL_WITH_POS (y)->sym : (y)))
 
 #define lisp_h_FIXNUMP(x) \
    (! (((unsigned) (XLI (x) >> (USE_LSB_TAG ? 0 : FIXNUM_BITS)) \