]> git.eshelyaron.com Git - emacs.git/commitdiff
Rename `SUBR_NATIVE_COMPILED` to `NATIVE_COMP_FUNCTION` (bug#71123)
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 29 May 2024 00:49:55 +0000 (20:49 -0400)
committerEshel Yaron <me@eshelyaron.com>
Wed, 29 May 2024 10:12:42 +0000 (12:12 +0200)
Keep the name consistent with the naming used in the ELisp world.

* src/pdumper.c (dump_object_emacs_ptr, dump_do_fixup):
* src/eval.c (eval_sub, funcall_general, funcall_lambda):
* src/alloc.c (CHECK_ALLOCATED_AND_LIVE_SYMBOL, survives_gc_p):
* src/data.c (Fcl_type_of, Ffset, Fnative_comp_function_p)
(Fsubr_native_lambda_list, Finteractive_form):
* src/comp.c (check_comp_unit_relocs):
* src/bytecode.c (exec_byte_code):

* src/lisp.h (NATIVE_COMP_FUNCTIONP, NATIVE_COMP_FUNCTION_DYNP):
Rename from `SUBR_NATIVE_COMPILEDP` and `SUBR_NATIVE_COMPILED_DYNP`.

(cherry picked from commit 3480ca83510f1ad6026971c9031e2c65540d402a)

src/alloc.c
src/bytecode.c
src/comp.c
src/data.c
src/eval.c
src/lisp.h
src/pdumper.c

index 28e32554472cb34a4de18e4717eaea3ce2352de6..9304e4e42bb1705133fe6730852b254b2a539776 100644 (file)
@@ -7350,7 +7350,7 @@ process_mark_stack (ptrdiff_t base_sp)
 
              case PVEC_SUBR:
 #ifdef HAVE_NATIVE_COMP
-               if (SUBR_NATIVE_COMPILEDP (obj))
+               if (NATIVE_COMP_FUNCTIONP (obj))
                  {
                    set_vector_marked (ptr);
                    struct Lisp_Subr *subr = XSUBR (obj);
@@ -7550,7 +7550,7 @@ survives_gc_p (Lisp_Object obj)
 
     case Lisp_Vectorlike:
       survives_p =
-       (SUBRP (obj) && !SUBR_NATIVE_COMPILEDP (obj)) ||
+       (SUBRP (obj) && !NATIVE_COMP_FUNCTIONP (obj)) ||
        vector_marked_p (XVECTOR (obj));
       break;
 
index 03443ed54abc344a204e400c100b792f827e9b49..75f9f1d0ac7877fbcfe83f6d87672db48d47b381 100644 (file)
@@ -808,7 +808,7 @@ exec_byte_code (Lisp_Object fun, ptrdiff_t args_template,
              }
 
            Lisp_Object val;
-           if (SUBRP (call_fun) && !SUBR_NATIVE_COMPILED_DYNP (call_fun))
+           if (SUBRP (call_fun) && !NATIVE_COMP_FUNCTION_DYNP (call_fun))
              val = funcall_subr (XSUBR (call_fun), call_nargs, call_args);
            else
              val = funcall_general (original_fun, call_nargs, call_args);
index 545a8046377e7ede1ea13b6ac6cbba4153645e39..9ebb2f7fed6ac6204ad23b3117d69b8f0e4aa34c 100644 (file)
@@ -5297,7 +5297,7 @@ check_comp_unit_relocs (struct Lisp_Native_Comp_Unit *comp_u)
       Lisp_Object x = data_imp_relocs[i];
       if (EQ (x, Qlambda_fixup))
        return false;
-      else if (SUBR_NATIVE_COMPILEDP (x))
+      else if (NATIVE_COMP_FUNCTIONP (x))
        {
          if (NILP (Fgethash (x, comp_u->lambda_gc_guard_h, Qnil)))
            return false;
index e6106a1dbdfde79c1e74595a96372bf8ce6a461b..3490d4985c9053a6593a05b4902270452882d1ed 100644 (file)
@@ -239,7 +239,7 @@ a fixed set of types.  */)
         case PVEC_WINDOW: return Qwindow;
         case PVEC_SUBR:
           return XSUBR (object)->max_args == UNEVALLED ? Qspecial_form
-                 : SUBR_NATIVE_COMPILEDP (object) ? Qnative_comp_function
+                 : NATIVE_COMP_FUNCTIONP (object) ? Qnative_comp_function
                  : Qprimitive_function;
         case PVEC_CLOSURE:
           return CONSP (AREF (object, CLOSURE_CODE))
@@ -908,7 +908,7 @@ signal a `cyclic-function-indirection' error.  */)
 
   if (!NILP (Vnative_comp_enable_subr_trampolines)
       && SUBRP (function)
-      && !SUBR_NATIVE_COMPILEDP (function))
+      && !NATIVE_COMP_FUNCTIONP (function))
     CALLN (Ffuncall, Qcomp_subr_trampoline_install, symbol);
 #endif
 
@@ -1059,7 +1059,7 @@ DEFUN ("native-comp-function-p", Fnative_comp_function_p, Snative_comp_function_
        0, doc: /* Return t if the object is native compiled Lisp function, nil otherwise.  */)
   (Lisp_Object object)
 {
-  return SUBR_NATIVE_COMPILEDP (object) ? Qt : Qnil;
+  return NATIVE_COMP_FUNCTIONP (object) ? Qt : Qnil;
 }
 
 DEFUN ("subr-native-lambda-list", Fsubr_native_lambda_list,
@@ -1071,7 +1071,7 @@ function or t otherwise.  */)
   CHECK_SUBR (subr);
 
 #ifdef HAVE_NATIVE_COMP
-  if (SUBR_NATIVE_COMPILED_DYNP (subr))
+  if (NATIVE_COMP_FUNCTION_DYNP (subr))
     return XSUBR (subr)->lambda_list;
 #endif
   return Qt;
@@ -1148,7 +1148,7 @@ Value, if non-nil, is a list (interactive SPEC).  */)
 
   if (SUBRP (fun))
     {
-      if (SUBR_NATIVE_COMPILEDP (fun) && !NILP (XSUBR (fun)->intspec.native))
+      if (NATIVE_COMP_FUNCTIONP (fun) && !NILP (XSUBR (fun)->intspec.native))
        return XSUBR (fun)->intspec.native;
 
       const char *spec = XSUBR (fun)->intspec.string;
index 20b9ca9a0ec846faa475ab3bfc93ece64f44b0b5..1e0628b4aa3ac897a531a95d3030ba77fac253fa 100644 (file)
@@ -2534,7 +2534,7 @@ eval_sub (Lisp_Object form)
   else if (!NILP (fun) && (fun = XSYMBOL (fun)->u.s.function, SYMBOLP (fun)))
     fun = indirect_function (fun);
 
-  if (SUBRP (fun) && !SUBR_NATIVE_COMPILED_DYNP (fun))
+  if (SUBRP (fun) && !NATIVE_COMP_FUNCTION_DYNP (fun))
     {
       Lisp_Object args_left = original_args;
       ptrdiff_t numargs = list_length (args_left);
@@ -2640,7 +2640,7 @@ eval_sub (Lisp_Object form)
        }
     }
   else if (CLOSUREP (fun)
-          || SUBR_NATIVE_COMPILED_DYNP (fun)
+          || NATIVE_COMP_FUNCTION_DYNP (fun)
           || MODULE_FUNCTIONP (fun))
     return apply_lambda (fun, original_args, count);
   else
@@ -3036,10 +3036,10 @@ funcall_general (Lisp_Object fun, ptrdiff_t numargs, Lisp_Object *args)
       && (fun = XSYMBOL (fun)->u.s.function, SYMBOLP (fun)))
     fun = indirect_function (fun);
 
-  if (SUBRP (fun) && !SUBR_NATIVE_COMPILED_DYNP (fun))
+  if (SUBRP (fun) && !NATIVE_COMP_FUNCTION_DYNP (fun))
     return funcall_subr (XSUBR (fun), numargs, args);
   else if (CLOSUREP (fun)
-          || SUBR_NATIVE_COMPILED_DYNP (fun)
+          || NATIVE_COMP_FUNCTION_DYNP (fun)
           || MODULE_FUNCTIONP (fun))
     return funcall_lambda (fun, numargs, args);
   else
@@ -3262,7 +3262,7 @@ funcall_lambda (Lisp_Object fun, ptrdiff_t nargs, Lisp_Object *arg_vector)
     return funcall_module (fun, nargs, arg_vector);
 #endif
 #ifdef HAVE_NATIVE_COMP
-  else if (SUBR_NATIVE_COMPILED_DYNP (fun))
+  else if (NATIVE_COMP_FUNCTION_DYNP (fun))
     {
       syms_left = XSUBR (fun)->lambda_list;
       lexenv = Qnil;
@@ -3335,9 +3335,9 @@ funcall_lambda (Lisp_Object fun, ptrdiff_t nargs, Lisp_Object *arg_vector)
   Lisp_Object val;
   if (CONSP (fun))
     val = Fprogn (XCDR (XCDR (fun)));
-  else if (SUBR_NATIVE_COMPILEDP (fun))
+  else if (NATIVE_COMP_FUNCTIONP (fun))
     {
-      eassert (SUBR_NATIVE_COMPILED_DYNP (fun));
+      eassert (NATIVE_COMP_FUNCTION_DYNP (fun));
       /* No need to use funcall_subr as we have zero arguments by
         construction.  */
       val = XSUBR (fun)->function.a0 ();
index f8d59b1e9fd6946df498899c628d77ee17f1f66a..67fcb146515839f7d8718e8fa0b4ae2e872b9ee9 100644 (file)
@@ -5542,15 +5542,15 @@ extern void syms_of_textconv (void);
 
 #ifdef HAVE_NATIVE_COMP
 INLINE bool
-SUBR_NATIVE_COMPILEDP (Lisp_Object a)
+NATIVE_COMP_FUNCTIONP (Lisp_Object a)
 {
   return SUBRP (a) && !NILP (XSUBR (a)->native_comp_u);
 }
 
 INLINE bool
-SUBR_NATIVE_COMPILED_DYNP (Lisp_Object a)
+NATIVE_COMP_FUNCTION_DYNP (Lisp_Object a)
 {
-  return SUBR_NATIVE_COMPILEDP (a) && !NILP (XSUBR (a)->lambda_list);
+  return NATIVE_COMP_FUNCTIONP (a) && !NILP (XSUBR (a)->lambda_list);
 }
 
 INLINE Lisp_Object
@@ -5567,13 +5567,13 @@ allocate_native_comp_unit (void)
 }
 #else
 INLINE bool
-SUBR_NATIVE_COMPILEDP (Lisp_Object a)
+NATIVE_COMP_FUNCTIONP (Lisp_Object a)
 {
   return false;
 }
 
 INLINE bool
-SUBR_NATIVE_COMPILED_DYNP (Lisp_Object a)
+NATIVE_COMP_FUNCTION_DYNP (Lisp_Object a)
 {
   return false;
 }
index 3806953f2c2aab742733128f507da0354c8eaa3f..8946c317bf98482e9958f7131fbe21bcbda40ca4 100644 (file)
@@ -931,7 +931,7 @@ dump_note_reachable (struct dump_context *ctx, Lisp_Object object)
 static void *
 dump_object_emacs_ptr (Lisp_Object lv)
 {
-  if (SUBRP (lv) && !SUBR_NATIVE_COMPILEDP (lv))
+  if (SUBRP (lv) && !NATIVE_COMP_FUNCTIONP (lv))
     return XSUBR (lv);
   if (dump_builtin_symbol_p (lv))
     return XSYMBOL (lv);
@@ -3988,7 +3988,7 @@ dump_do_fixup (struct dump_context *ctx,
       /* Dump wants a pointer to a Lisp object.
          If DUMP_FIXUP_LISP_OBJECT_RAW, we should stick a C pointer in
          the dump; otherwise, a Lisp_Object.  */
-      if (SUBRP (arg) && !SUBR_NATIVE_COMPILEDP (arg))
+      if (SUBRP (arg) && !NATIVE_COMP_FUNCTIONP (arg))
         {
           dump_value = emacs_offset (XSUBR (arg));
           if (type == DUMP_FIXUP_LISP_OBJECT)