emacs-diffs
[Top][All Lists]
Advanced

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

feature/inhibit-native-comp-cleanup 5d0912f144 1/4: Rename comp-enable-s


From: Andrea Corallo
Subject: feature/inhibit-native-comp-cleanup 5d0912f144 1/4: Rename comp-enable-subr-trampolines into native-comp-enable-subr-trampolines
Date: Mon, 13 Feb 2023 11:15:13 -0500 (EST)

branch: feature/inhibit-native-comp-cleanup
commit 5d0912f1445e33f1ccf23a84f0dc6d08c4ee2b60
Author: Andrea Corallo <akrl@sdf.org>
Commit: Andrea Corallo <akrl@sdf.org>

    Rename comp-enable-subr-trampolines into native-comp-enable-subr-trampolines
    
            * src/data.c (Ffset): Rename comp-enable-subr-trampolines into
            native-comp-enable-subr-trampolines.
    
            * src/comp.c (syms_of_comp): Likewise.
    
            * lisp/subr.el (comp-enable-subr-trampolines): Make
            comp-enable-subr-trampolines obsolete.
    
            * lisp/startup.el (native-comp-enable-subr-trampolines)
            (normal-top-level): Rename comp-enable-subr-trampolines into
            native-comp-enable-subr-trampolines.
    
            * lisp/loadup.el (dump-mode): Likewise.
    
            * lisp/emacs-lisp/comp.el (comp-subr-trampoline-install)
            (comp--trampoline-abs-filename): Likewise.
---
 lisp/emacs-lisp/comp.el | 6 +++---
 lisp/loadup.el          | 2 +-
 lisp/startup.el         | 4 ++--
 lisp/subr.el            | 4 ++++
 src/comp.c              | 3 ++-
 src/data.c              | 2 +-
 6 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index 5077ca0aa1..fc1862a45e 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -700,7 +700,7 @@ Useful to hook into pass checkers.")
 ;;;###autoload
 (defun comp-subr-trampoline-install (subr-name)
   "Make SUBR-NAME effectively advice-able when called from native code."
-  (unless (or (null comp-enable-subr-trampolines)
+  (unless (or (null native-comp-enable-subr-trampolines)
               (memq subr-name native-comp-never-optimize-functions)
               (gethash subr-name comp-installed-trampolines-h))
     (cl-assert (subr-primitive-p (symbol-function subr-name)))
@@ -3790,8 +3790,8 @@ Return the trampoline if found or nil otherwise."
 (defun comp--trampoline-abs-filename (subr-name)
   "Return the absolute filename for a trampoline for SUBR-NAME."
   (cl-loop
-   with dirs = (if (stringp comp-enable-subr-trampolines)
-                   (list comp-enable-subr-trampolines)
+   with dirs = (if (stringp native-comp-enable-subr-trampolines)
+                   (list native-comp-enable-subr-trampolines)
                  (if native-compile-target-directory
                      (list (expand-file-name comp-native-version-dir
                                              native-compile-target-directory))
diff --git a/lisp/loadup.el b/lisp/loadup.el
index 5c57686157..46b26750cd 100644
--- a/lisp/loadup.el
+++ b/lisp/loadup.el
@@ -550,7 +550,7 @@ lost after dumping")))
                  (equal dump-mode "pdump"))
         ;; Don't enable this before bootstrap is completed, as the
         ;; compiler infrastructure may not be usable yet.
-        (setq comp-enable-subr-trampolines t))
+        (setq native-comp-enable-subr-trampolines t))
       (message "Dumping under the name %s" output)
       (condition-case ()
           (delete-file output)
diff --git a/lisp/startup.el b/lisp/startup.el
index 240cfa3009..ddbb39df85 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -543,7 +543,7 @@ DIRS are relative."
 
 (defvar native-comp-eln-load-path)
 (defvar native-comp-deferred-compilation)
-(defvar comp-enable-subr-trampolines)
+(defvar native-comp-enable-subr-trampolines)
 
 (defvar startup--original-eln-load-path nil
   "Original value of `native-comp-eln-load-path'.")
@@ -598,7 +598,7 @@ It is the default value of the variable `top-level'."
         ;; available on MS-Windows, but Emacs was built with
         ;; native-compilation support.
         (setq native-comp-deferred-compilation nil
-              comp-enable-subr-trampolines nil))
+              native-comp-enable-subr-trampolines nil))
 
       ;; Form `native-comp-eln-load-path'.
       (let ((path-env (getenv "EMACSNATIVELOADPATH")))
diff --git a/lisp/subr.el b/lisp/subr.el
index a56aeab724..56c8377da8 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1894,6 +1894,10 @@ activations.  To prevent runaway recursion, use 
`max-lisp-eval-depth'
 instead; it will indirectly limit the specpdl stack size as well.")
 (make-obsolete-variable 'max-specpdl-size nil "29.1")
 
+(make-obsolete-variable 'comp-enable-subr-trampolines
+                        'native-comp-enable-subr-trampolines
+                        "29.1")
+
 
 ;;;; Alternate names for functions - these are not being phased out.
 
diff --git a/src/comp.c b/src/comp.c
index 82224845bf..ba3ed95bcc 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -5858,7 +5858,8 @@ The last directory of this list is assumed to be the 
system one.  */);
      dump reload.  */
   Vnative_comp_eln_load_path = Fcons (build_string ("../native-lisp/"), Qnil);
 
-  DEFVAR_LISP ("comp-enable-subr-trampolines", Vcomp_enable_subr_trampolines,
+  DEFVAR_LISP ("native-comp-enable-subr-trampolines",
+              Vnative_comp_enable_subr_trampolines,
               doc: /* If non-nil, enable primitive trampoline synthesis.
 This makes Emacs respect redefinition or advises of primitive functions
 when they are called from Lisp code natively-compiled at `native-comp-speed'
diff --git a/src/data.c b/src/data.c
index a43fa8991f..0f1d881e00 100644
--- a/src/data.c
+++ b/src/data.c
@@ -855,7 +855,7 @@ DEFUN ("fset", Ffset, Sfset, 2, 2, 0,
 #ifdef HAVE_NATIVE_COMP
   register Lisp_Object function = XSYMBOL (symbol)->u.s.function;
 
-  if (!NILP (Vcomp_enable_subr_trampolines)
+  if (!NILP (Vnative_comp_enable_subr_trampolines)
       && SUBRP (function)
       && !SUBR_NATIVE_COMPILEDP (function))
     CALLN (Ffuncall, Qcomp_subr_trampoline_install, symbol);



reply via email to

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