1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

Merge from origin/emacs-29

1769a58830 Fix some uses of 'use-dialog-box'
deef41a825 Fix hi-lock-tests when 'use-dialog-box' is non-nil
5093a53496 Fix regression due to change in face sort order by 'face-...
3e74763099 * lisp/files.el (file-equal-p): Work around Haiku stat bug.
13fd7667f9 ; * src/treesit.c: Improve sectioning.
a40b1745d4 (project-vc-backend-markers-alist): Add entry for vc-got
18e96ed7c8 project.el: Extract backend->marker association for a defvar
0a5615669a Don't completely clip into visible range in treesit_recor...
5b34fc0708 * lisp/treesit.el (treesit-node-at): Update docstring (bu...
1c7d762378 ; Minor copyedit of NEWS wrt *-ts-modes
09fad246de * lisp/calc/calc.el (calc-mode): Improve docstring.
8aad8d75aa ; Improve and update documentation of native compilation
d6e4f24372 Merge 'emacs-29' into 'feature/inhibit-native-comp-cleanup'
a555abc56d Fix order of faces in 'face-list'
b44a7ff85d Allow 'icon-title-format' to have the value t
f1f571e72a Add electric indent for preproc directives
83af806ab7 Rename 'emacs-news-toggle-tag' to 'emacs-news-cycle-tag'
5bc88b3b17 Add menu to news-mode
40f4bc4e0a ; Avoid installing VC package dependencies multiple times
1c9d81a2b4 Attempt to recognise if a VC package has no Elisp files
2550e8bb0b Fix mule-tests under en_US.UTF-8 locale
3279530993 Move block closer above declaration_list rule (bug#61531)
b18754bb17 Minor improvements in c-ts-mode and docs
3c6b726a7b Add super node as a keyword
1917c51fe6 ; Prevent ERC-induced false positive in JUnit report
b16965ef7e Delete perplexing paragraph from Gnus manual
43c62a4732 ; Fix typo
fdac69b45e ; Auto-commit of loaddefs files.
7678b7e46f Eglot: check server capability before sending didSave (bu...
a3a1ef7bd5 Fix rust-ts-mode type and module highlighting (Bug#61302)
477aa047ee rust-ts-mode: Highlight variable reassignments
5206a551c1 Improve backward compatibility of save-restriction
accd88d554 Don't indent template_string contents (bug#61503)
d97a383996 csharp-ts-mode: fontify compiler directives (bug#61512)
420d2cae84 Update to Transient v0.3.7-209-gdab1dfa
a3751b5d0c ; Raise an error if a VC package checkout is empty
6a32ba8b69 ; Fix the installation of dependencies for VC packages
4eac80fcc3 ; Prepare to update ERC version to 5.5
4f099a7217 ; Remove failing erc-reuse-buffers test
ce4a066ed1 * Generate trampolines in a temporary directory if no oth...
4bb27a5ca9 ; Minor docs copyedits
13bcff3da5 Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/...
3d572ae0d5 Rename with/without-narrowing to with/without-restriction
d806b0e33c * lisp/repeat.el: Rename internal function and variable (...
1a64f326e0 * Fix previous change
95692f6754 Rename native-comp-deferred-compilation-deny-list
8d8464bd5a Rename native-comp-deferred-compilation into native-comp-...
5d0912f144 Rename comp-enable-subr-trampolines into native-comp-enab...
dd8b720ee7 ; * etc/NEWS: Fix typos.
909bd04cf5 ; * lisp/calendar/lunar.el: Add comments. (bug#61460)
10f2aedea9 ; * lisp/progmodes/c-ts-mode.el (c-ts-base-mode): delete ...
abfd00e5c0 * lisp/emacs-lisp/comp.el (native-comp-never-optimize-fun...
1795839bab Support `comp-enable-subr-trampolines' as string value
865758130a ; * admin/git-bisect-start: Update failing commits
b948d0d7ef Merge branch 'scratch/fix-locked-narrowing'
b6e2799aa1 * Some more `inhibit-native-compile' clean-up
dcb2379a46 Minor improvements to labeled narrowing
c0681cd347 Revert "Add new variable 'inhibit-native-compilation'"
3969a34fa1 Revert "Rename to inhibit-automatic-native-compilation"
4297039bd1 Save and restore the absence of narrowing locks
2956e54b1d Add an extensive test for labeled (locked) narrowing
79ce185ad1 Update the documentation about labeled (locked) narrowing
a6cd4553d4 Rename two long line optimizations variables
0d73e4aa26 Add specific symbols for narrowings
d8438e2bb4 Add 'without-narrowing' macro
97314447e6 Make 'narrowing-lock' and 'narrowing-unlock' internal
a4aa32bdff Fix 'save-restriction' for narrowing locks
This commit is contained in:
Stefan Kangas 2023-02-18 10:45:46 +01:00
commit 0be5f7ab63
21 changed files with 364 additions and 223 deletions

View file

@ -85,13 +85,17 @@ This is intended for debugging the compiler itself.
:type 'boolean
:version "28.1")
(defcustom native-comp-deferred-compilation-deny-list
(defcustom native-comp-jit-compilation-deny-list
'()
"List of regexps to exclude matching files from deferred native compilation.
Files whose names match any regexp are excluded from native compilation."
:type '(repeat regexp)
:version "28.1")
(make-obsolete-variable 'native-comp-deferred-compilation-deny-list
'native-comp-jit-compilation-deny-list
"29.1")
(defcustom native-comp-bootstrap-deny-list
'()
"List of regexps to exclude files from native compilation during bootstrap.
@ -105,7 +109,11 @@ during bootstrap."
;; correctly (see comment in `advice--add-function'). DO NOT
;; REMOVE.
macroexpand rename-buffer)
"Primitive functions to exclude from trampoline optimization."
"Primitive functions to exclude from trampoline optimization.
Primitive functions included in this list will not be called
directly by the natively-compiled code, which makes trampolines for
those primitives unnecessary in case of function redefinition/advice."
:type '(repeat symbol)
:version "28.1")
@ -695,7 +703,7 @@ Useful to hook into pass checkers.")
;;;###autoload
(defun comp-subr-trampoline-install (subr-name)
"Make SUBR-NAME effectively advice-able when called from native code."
(unless (or (null comp-enable-subr-trampolines)
(unless (or (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 (symbol-function subr-name)))
@ -3782,6 +3790,32 @@ Return the trampoline if found or nil otherwise."
when (file-exists-p filename)
do (cl-return (native-elisp-load filename))))
(defun comp--trampoline-abs-filename (subr-name)
"Return the absolute filename for a trampoline for SUBR-NAME."
(cl-loop
with dirs = (if (stringp native-comp-enable-subr-trampolines)
(list native-comp-enable-subr-trampolines)
(if native-compile-target-directory
(list (expand-file-name comp-native-version-dir
native-compile-target-directory))
(comp-eln-load-path-eff)))
with rel-filename = (comp-trampoline-filename subr-name)
for dir in dirs
for abs-filename = (expand-file-name rel-filename dir)
unless (file-exists-p dir)
do (ignore-errors
(make-directory dir t)
(cl-return abs-filename))
when (file-writable-p abs-filename)
do (cl-return abs-filename)
;; Default to some temporary directory if no better option was
;; found.
finally (cl-return
(expand-file-name
(make-temp-file-internal (file-name-sans-extension rel-filename)
0 ".eln" nil)
temporary-file-directory))))
(defun comp-trampoline-compile (subr-name)
"Synthesize compile and return a trampoline for SUBR-NAME."
(let* ((lambda-list (comp-make-lambda-list-from-subr
@ -3803,25 +3837,7 @@ Return the trampoline if found or nil otherwise."
(lexical-binding t))
(comp--native-compile
form nil
;; If we've disabled nativecomp, don't write the trampolines to
;; the eln cache (but create them).
(unless inhibit-automatic-native-compilation
(cl-loop
for dir in (if native-compile-target-directory
(list (expand-file-name comp-native-version-dir
native-compile-target-directory))
(comp-eln-load-path-eff))
for f = (expand-file-name
(comp-trampoline-filename subr-name)
dir)
unless (file-exists-p dir)
do (ignore-errors
(make-directory dir t)
(cl-return f))
when (file-writable-p f)
do (cl-return f)
finally (error "Cannot find suitable directory for output in \
`native-comp-eln-load-path'"))))))
(comp--trampoline-abs-filename subr-name))))
;; Some entry point support code.
@ -4110,14 +4126,12 @@ the deferred compilation mechanism."
data
;; So we return the compiled function.
(native-elisp-load data)))
;; We may have created a temporary file when we're being
;; called with something other than a file as the argument.
;; Delete it if we can.
(when (and (not (stringp function-or-file))
(not output)
comp-ctxt
(comp-ctxt-output comp-ctxt)
(file-exists-p (comp-ctxt-output comp-ctxt)))
;; NOTE: Not sure if we want to remove this or being cautious.
(cond ((eq 'windows-nt system-type)
;; We may still be using the temporary .eln file.
(ignore-errors (delete-file (comp-ctxt-output comp-ctxt))))
@ -4137,11 +4151,11 @@ LOAD and SELECTOR work as described in `native--compile-async'."
(t (error "SELECTOR must be a function a regexp or nil")))
;; Also exclude files from deferred compilation if
;; any of the regexps in
;; `native-comp-deferred-compilation-deny-list' matches.
;; `native-comp-jit-compilation-deny-list' matches.
(and (eq load 'late)
(cl-some (lambda (re)
(string-match-p re file))
native-comp-deferred-compilation-deny-list))))
native-comp-jit-compilation-deny-list))))
(defun native--compile-async (files &optional recursively load selector)
;; BEWARE, this function is also called directly from C.