[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#43725: 28.0.50; Include feature/native-comp into master
From: |
Andrea Corallo |
Subject: |
bug#43725: 28.0.50; Include feature/native-comp into master |
Date: |
Sun, 14 Feb 2021 20:22:10 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Eli Zaretskii <eliz@gnu.org> writes:
> Andrea, can you please explain why there are so many changes in Lisp
> files on the branch?
>
> For example, what are changes like this one about:
>
> +(declare-function subr-native-lambda-list "data.c")
`subr-native-lambda-list' returns the lambda list for a dynamic native
compiled function or t if lexically scoped.
This is available only building "--with-nativecomp", this is to remove a
bytecompiler warning for vanilla build.
> Or this:
>
> + ((and (featurep 'nativecomp)
> + (subrp def)
> + (listp (subr-native-lambda-list def)))
> + (subr-native-lambda-list def))
This is to retrive the lambda list of dynamic scoped native compiled
lisp function so that `help-function-arglist' can return it.
> Or this:
>
> + ;; Never native compile to allow cc-defs.el:2345 hack.
> + (declare (speed -1))
cc-defs does a dirty hack where is capturing the bytecode object of
`cc-bytecomp-compiling-or-loading'.
>From cc-defs.el:
========
;; Ugly hack to pull in the definition of `cc-bytecomp-compiling-or-loading'
;; from cc-bytecomp to make it available at loadtime. This is the same
;; mechanism used in cc-mode.el for `c-populate-syntax-table'.
(defalias 'cc-bytecomp-compiling-or-loading
(cc-eval-when-compile
(let ((f (symbol-function 'cc-bytecomp-compiling-or-loading)))
(if (byte-code-function-p f) f (byte-compile f)))))
========
Native code cannot go through the read print loop so this hack can't
work native compiling the function, speed -1 ensure the function is
present in the eln file but in form of bytecode.
> This will not work on MS-Windows, you need to use path-separator to do
> it portably:
>
> + (when (featurep 'nativecomp)
> + (defvar comp-eln-load-path)
> + (let ((path-env (getenv "EMACSNATIVELOADPATH")))
> + (when path-env
> + (dolist (path (split-string path-env ":")) <<<<<<<<<<<<<
> + (unless (string= "" path)
> + (push path comp-eln-load-path)))))
> + (push (concat user-emacs-directory "eln-cache/") comp-eln-load-path))
Fixed by 31416495ad.
I'll keep on working through your points the coming week, sincere thanks
for reviewing.
Andrea
- bug#43725: 28.0.50; Include feature/native-comp into master, Eli Zaretskii, 2021/02/13
- bug#43725: 28.0.50; Include feature/native-comp into master,
Andrea Corallo <=
- bug#43725: 28.0.50; Include feature/native-comp into master, Andrea Corallo, 2021/02/16
- bug#43725: 28.0.50; Include feature/native-comp into master, Andrea Corallo, 2021/02/18
- bug#43725: 28.0.50; Include feature/native-comp into master, Eli Zaretskii, 2021/02/18
- bug#43725: 28.0.50; Include feature/native-comp into master, Andrea Corallo, 2021/02/18
- bug#43725: 28.0.50; Include feature/native-comp into master, Eli Zaretskii, 2021/02/19
- bug#43725: 28.0.50; Include feature/native-comp into master, Andrea Corallo, 2021/02/19
- bug#43725: 28.0.50; Include feature/native-comp into master, Eli Zaretskii, 2021/02/19