]> git.eshelyaron.com Git - emacs.git/commitdiff
add customize comp-never-optimize-functions
authorAndrea Corallo <akrl@sdf.org>
Sun, 29 Dec 2019 13:10:19 +0000 (14:10 +0100)
committerAndrea Corallo <akrl@sdf.org>
Wed, 1 Jan 2020 10:38:18 +0000 (11:38 +0100)
lisp/emacs-lisp/comp.el

index b212f24bf9cc9e41625a2d78ca24f5f826914620..99cc93580bf64257c8d93a48ee1716d56e77fa22 100644 (file)
@@ -74,6 +74,15 @@ This intended for debugging the compiler itself.
   :type 'boolean
   :group 'comp)
 
+(defcustom comp-never-optimize-functions
+  '(macroexpand scroll-down scroll-up narrow-to-region widen rename-buffer
+                make-indirect-buffer delete-file top-level abort-recursive-edit)
+  "Primitive functions for which we do not perform trampoline optimization.
+This is especially usefull for primitives known to be advised if bootstrap is
+performed at `comp-speed' > 0."
+  :type 'list
+  :group 'comp)
+
 (defconst comp-log-buffer-name "*Native-compile-Log*"
   "Name of the native-compiler log buffer.")
 
@@ -1631,7 +1640,8 @@ Return t if something was changed."
                       (setf (comp-mvar-ref arg) nil))
                     args)
               args))
-    (when (symbolp callee) ; Do nothing if callee is a byte compiled func.
+    (when (and (symbolp callee)  ; Do nothing if callee is a byte compiled func.
+               (not (member callee comp-never-optimize-functions)))
       (let* ((f (symbol-function callee))
              (subrp (subrp f))
              (callee-in-unit (gethash callee