[Top][All Lists]

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

feature/native-comp 883d937: Make `comp-enable-subr-trampolines' effecti

From: Andrea Corallo
Subject: feature/native-comp 883d937: Make `comp-enable-subr-trampolines' effective for advices (bug#45854)
Date: Sun, 17 Jan 2021 11:02:32 -0500 (EST)

branch: feature/native-comp
commit 883d937320a8be2bdc6d0ab7b5dd9551cbfeebd4
Author: Andrea Corallo <akrl@sdf.org>
Commit: Andrea Corallo <akrl@sdf.org>

    Make `comp-enable-subr-trampolines' effective for advices (bug#45854)
        * src/comp.c: Copyright update.
        (syms_of_comp): Update `comp-enable-subr-trampolines' doc.
        * lisp/emacs-lisp/comp.el (comp-subr-trampoline-install): Check
        for `comp-enable-subr-trampolines'.
 lisp/emacs-lisp/comp.el | 3 ++-
 src/comp.c              | 6 +++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index d127cea..238d86f 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -3668,7 +3668,8 @@ Return the trampoline if found or nil otherwise."
 (defun comp-subr-trampoline-install (subr-name)
   "Make SUBR-NAME effectively advice-able when called from native code."
-  (unless (or (memq subr-name comp-never-optimize-functions)
+  (unless (or (null comp-enable-subr-trampolines)
+              (memq subr-name comp-never-optimize-functions)
               (gethash subr-name comp-installed-trampolines-h))
     (cl-assert (subr-primitive-p (symbol-function subr-name)))
diff --git a/src/comp.c b/src/comp.c
index 619f5e1..b5adc3e 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -1,5 +1,5 @@
 /* Compile elisp into native code.
-   Copyright (C) 2019-2020 Free Software Foundation, Inc.
+   Copyright (C) 2019-2021 Free Software Foundation, Inc.
 Author: Andrea Corallo <akrl@sdf.org>
@@ -5269,8 +5269,8 @@ The last directory of this list is assumed to be the 
system one.  */);
   Vcomp_eln_load_path = Fcons (build_string ("../native-lisp/"), Qnil);
   DEFVAR_BOOL ("comp-enable-subr-trampolines", comp_enable_subr_trampolines,
-              doc: /* If non-nil, enable trampoline synthesis triggered by 
-This makes primitives redefinable effectively.  */);
+              doc: /* If non-nil enable primitive trampoline synthesis.
+This makes primitive functions redefinable or advisable effectively.  */);
   DEFVAR_LISP ("comp-installed-trampolines-h", Vcomp_installed_trampolines_h,
               doc: /* Hash table subr-name -> installed trampoline.

reply via email to

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