Function: comp-subr-trampoline-install

comp-subr-trampoline-install is an autoloaded and byte-compiled function defined in comp.el.gz.

Signature

(comp-subr-trampoline-install SUBR-NAME)

Documentation

Make SUBR-NAME effectively advice-able when called from native code.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/comp.el.gz
;; Moved early to avoid circularity when comp.el is loaded and
;; `macroexpand' needs to be advised (bug#47049).
;;;###autoload
(defun comp-subr-trampoline-install (subr-name)
  "Make SUBR-NAME effectively advice-able when called from native code."
  (when (memq subr-name comp-warn-primitives)
    (warn "Redefining `%s' might break native compilation of trampolines."
          subr-name))
  (let ((subr (symbol-function subr-name)))
    (unless (or (not (string= subr-name (subr-name subr))) ;; (bug#69573)
                (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 subr))
      (when-let ((trampoline (or (comp-trampoline-search subr-name)
                                 (comp-trampoline-compile subr-name))))
        (comp--install-trampoline subr-name trampoline)))))