From 9a8f33f285295daff8ed02d35ece5e8fe11ac887 Mon Sep 17 00:00:00 2001
From: Andrea Corallo <akrl@sdf.org>
Date: Fri, 20 Dec 2019 05:53:28 +0100
Subject: [PATCH] introduce SUBRP_NATIVE_COMPILEDP

---
 src/alloc.c | 4 ++--
 src/data.c  | 4 ++--
 src/lisp.h  | 8 ++++++++
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/alloc.c b/src/alloc.c
index d990f53f7a0..dba2c2df881 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -6566,7 +6566,7 @@ mark_object (Lisp_Object arg)
 
 	  case PVEC_SUBR:
 #ifdef HAVE_NATIVE_COMP
-	    if (XSUBR (obj)->native_comp_u)
+	    if (SUBRP_NATIVE_COMPILEDP (obj))
 	      set_vector_marked (ptr);
 #endif
 	    break;
@@ -6715,7 +6715,7 @@ survives_gc_p (Lisp_Object obj)
     case Lisp_Vectorlike:
 #ifdef HAVE_NATIVE_COMP
       survives_p =
-	(SUBRP (obj) && !XSUBR (obj)->native_comp_u) ||
+	(SUBRP (obj) && !SUBRP_NATIVE_COMPILEDP (obj)) ||
 	vector_marked_p (XVECTOR (obj));
 #else
       survives_p = SUBRP (obj) || vector_marked_p (XVECTOR (obj));
diff --git a/src/data.c b/src/data.c
index 0a13569bc6d..fd20ecce696 100644
--- a/src/data.c
+++ b/src/data.c
@@ -870,7 +870,7 @@ DEFUN ("subr-native-elisp-p", Fsubr_native_elisp_p, Ssubr_native_elisp_p, 1, 1,
 nil otherwise.  */)
   (Lisp_Object object)
 {
-  return (SUBRP (object) && XSUBR (object)->native_comp_u) ? Qt : Qnil;
+  return SUBRP_NATIVE_COMPILEDP (object) ? Qt : Qnil;
 }
 #endif
 
@@ -900,7 +900,7 @@ Value, if non-nil, is a list (interactive SPEC).  */)
   if (SUBRP (fun))
     {
 #ifdef HAVE_NATIVE_COMP
-      if (XSUBR (fun)->native_comp_u && XSUBR (fun)->native_intspec)
+      if (SUBRP_NATIVE_COMPILEDP (fun) && XSUBR (fun)->native_intspec)
 	return XSUBR (fun)->native_intspec;
 #endif
       const char *spec = XSUBR (fun)->intspec;
diff --git a/src/lisp.h b/src/lisp.h
index bb441b181a1..05d6ef0d22a 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -2136,6 +2136,14 @@ enum char_table_specials
       = PSEUDOVECSIZE (struct Lisp_Sub_Char_Table, contents) - 1
   };
 
+#ifdef HAVE_NATIVE_COMP
+INLINE bool
+SUBRP_NATIVE_COMPILEDP (Lisp_Object a)
+{
+  return SUBRP (a) && XSUBR (a)->native_comp_u;
+}
+#endif
+
 /* Sanity-check pseudovector layout.  */
 verify (offsetof (struct Lisp_Char_Table, defalt) == header_size);
 verify (offsetof (struct Lisp_Char_Table, extras)
-- 
2.39.5