Function: comp--func-in-unit
comp--func-in-unit is a byte-compiled function defined in comp.el.gz.
Signature
(comp--func-in-unit FUNC)
Documentation
Given FUNC return the comp-fun definition in the current context.
FUNCTION can be a function-name or byte compiled function.
Source Code
;; Defined in /usr/src/emacs/lisp/emacs-lisp/comp.el.gz
;;; Call optimizer pass specific code.
;; This pass is responsible for the following optimizations:
;; - Call to subrs that are in defined in the C source and are passing through
;; funcall trampoline gets optimized into normal indirect calls.
;; This makes effectively this calls equivalent to all the subrs that got
;; dedicated byte-code ops.
;; Triggered at native-comp-speed >= 2.
;; - Recursive calls gets optimized into direct calls.
;; Triggered at native-comp-speed >= 2.
;; - Intra compilation unit procedure calls gets optimized into direct calls.
;; This can be a big win and even allow gcc to inline but does not make
;; function in the compilation unit re-definable safely without recompiling
;; the full compilation unit.
;; For this reason this is triggered only at native-comp-speed == 3.
(defun comp--func-in-unit (func)
"Given FUNC return the `comp-fun' definition in the current context.
FUNCTION can be a function-name or byte compiled function."
(if (symbolp func)
(comp--symbol-func-to-fun func)
(cl-assert (byte-code-function-p func))
(gethash func (comp-ctxt-byte-func-to-func-h comp-ctxt))))