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.
This commit is contained in:
Andrea Corallo 2023-02-13 16:33:40 +01:00
commit 5d0912f144
6 changed files with 13 additions and 8 deletions

View file

@ -700,7 +700,7 @@ Useful to hook into pass checkers.")
;;;###autoload ;;;###autoload
(defun comp-subr-trampoline-install (subr-name) (defun comp-subr-trampoline-install (subr-name)
"Make SUBR-NAME effectively advice-able when called from native code." "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) (memq subr-name native-comp-never-optimize-functions)
(gethash subr-name comp-installed-trampolines-h)) (gethash subr-name comp-installed-trampolines-h))
(cl-assert (subr-primitive-p (symbol-function subr-name))) (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) (defun comp--trampoline-abs-filename (subr-name)
"Return the absolute filename for a trampoline for SUBR-NAME." "Return the absolute filename for a trampoline for SUBR-NAME."
(cl-loop (cl-loop
with dirs = (if (stringp comp-enable-subr-trampolines) with dirs = (if (stringp native-comp-enable-subr-trampolines)
(list comp-enable-subr-trampolines) (list native-comp-enable-subr-trampolines)
(if native-compile-target-directory (if native-compile-target-directory
(list (expand-file-name comp-native-version-dir (list (expand-file-name comp-native-version-dir
native-compile-target-directory)) native-compile-target-directory))

View file

@ -550,7 +550,7 @@ lost after dumping")))
(equal dump-mode "pdump")) (equal dump-mode "pdump"))
;; Don't enable this before bootstrap is completed, as the ;; Don't enable this before bootstrap is completed, as the
;; compiler infrastructure may not be usable yet. ;; 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) (message "Dumping under the name %s" output)
(condition-case () (condition-case ()
(delete-file output) (delete-file output)

View file

@ -543,7 +543,7 @@ DIRS are relative."
(defvar native-comp-eln-load-path) (defvar native-comp-eln-load-path)
(defvar native-comp-deferred-compilation) (defvar native-comp-deferred-compilation)
(defvar comp-enable-subr-trampolines) (defvar native-comp-enable-subr-trampolines)
(defvar startup--original-eln-load-path nil (defvar startup--original-eln-load-path nil
"Original value of `native-comp-eln-load-path'.") "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 ;; available on MS-Windows, but Emacs was built with
;; native-compilation support. ;; native-compilation support.
(setq native-comp-deferred-compilation nil (setq native-comp-deferred-compilation nil
comp-enable-subr-trampolines nil)) native-comp-enable-subr-trampolines nil))
;; Form `native-comp-eln-load-path'. ;; Form `native-comp-eln-load-path'.
(let ((path-env (getenv "EMACSNATIVELOADPATH"))) (let ((path-env (getenv "EMACSNATIVELOADPATH")))

View file

@ -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.") instead; it will indirectly limit the specpdl stack size as well.")
(make-obsolete-variable 'max-specpdl-size nil "29.1") (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. ;;;; Alternate names for functions - these are not being phased out.

View file

@ -5858,7 +5858,8 @@ The last directory of this list is assumed to be the system one. */);
dump reload. */ dump reload. */
Vnative_comp_eln_load_path = Fcons (build_string ("../native-lisp/"), Qnil); 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. doc: /* If non-nil, enable primitive trampoline synthesis.
This makes Emacs respect redefinition or advises of primitive functions This makes Emacs respect redefinition or advises of primitive functions
when they are called from Lisp code natively-compiled at `native-comp-speed' when they are called from Lisp code natively-compiled at `native-comp-speed'

View file

@ -855,7 +855,7 @@ DEFUN ("fset", Ffset, Sfset, 2, 2, 0,
#ifdef HAVE_NATIVE_COMP #ifdef HAVE_NATIVE_COMP
register Lisp_Object function = XSYMBOL (symbol)->u.s.function; register Lisp_Object function = XSYMBOL (symbol)->u.s.function;
if (!NILP (Vcomp_enable_subr_trampolines) if (!NILP (Vnative_comp_enable_subr_trampolines)
&& SUBRP (function) && SUBRP (function)
&& !SUBR_NATIVE_COMPILEDP (function)) && !SUBR_NATIVE_COMPILEDP (function))
CALLN (Ffuncall, Qcomp_subr_trampoline_install, symbol); CALLN (Ffuncall, Qcomp_subr_trampoline_install, symbol);