Function: comp-trampoline-compile

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

Signature

(comp-trampoline-compile SUBR-NAME)

Documentation

Synthesize compile and return a trampoline for SUBR-NAME.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/comp.el.gz
;; Called from comp-run.el
;;;###autoload
(defun comp-trampoline-compile (subr-name)
  "Synthesize compile and return a trampoline for SUBR-NAME."
  (let* ((lambda-list (comp--make-lambda-list-from-subr
                       (symbol-function subr-name)))
         ;; The synthesized trampoline must expose the exact same ABI of
         ;; the primitive we are replacing in the function reloc table.
         (form `(lambda ,lambda-list
                  (let ((f #',subr-name))
                    (,(if (memq '&rest lambda-list) #'apply 'funcall)
                     f
                     ,@(cl-loop
                        for arg in lambda-list
                        unless (memq arg '(&optional &rest))
                        collect arg)))))
         ;; Use speed 1 for compilation speed and not to optimize away
         ;; funcall calls!
         (byte-optimize nil)
         (native-comp-speed 1)
         (lexical-binding t))
    (comp--native-compile
     form nil
     (comp--trampoline-abs-filename subr-name))))