Andrea Corallo
5d0b45cd67
Make the native compiler always use `make-temp-file' for temporary files
...
* src/comp.c (CALL4I): Define macro.
(Fcomp__compile_ctxt_to_file): Use `make-temp-file' instead of
`make-temp-file-internal'.
* lisp/emacs-lisp/comp.el (comp--trampoline-abs-filename): Likewise.
2023-02-20 21:16:04 +01:00
Andrea Corallo
c15bc91e1b
* Fix `native-comp-enable-subr-trampolines' semantic
...
* lisp/emacs-lisp/comp.el (comp--trampoline-abs-filename): Interpret
`native-comp-enable-subr-trampolines' relative to
`invocation-directory'.
2023-02-18 22:44:05 +01:00
Eli Zaretskii
8aad8d75aa
; Improve and update documentation of native compilation
...
* src/comp.c (syms_of_comp) <native-comp-enable-subr-trampolines>
<native-comp-eln-load-path>: Doc fixes.
* lisp/emacs-lisp/comp.el (native-comp-never-optimize-functions):
Doc fix.
* doc/lispref/compile.texi (Native-Compilation Variables):
Document 'native-comp-jit-compilation' and
'native-comp-enable-subr-trampolines'.
2023-02-17 16:15:51 +02:00
Andrea Corallo
ce4a066ed1
* Generate trampolines in a temporary directory if no other option is viable
...
* lisp/emacs-lisp/comp.el (comp--trampoline-abs-filename): Use
temporary file if no other option is viable.
2023-02-14 12:27:58 +01:00
Andrea Corallo
95692f6754
Rename native-comp-deferred-compilation-deny-list
...
* lisp/emacs-lisp/comp.el (native-comp-jit-compilation-deny-list)
(native-compile-async-skip-p): Rename
native-comp-deferred-compilation-deny-list into
native-comp-jit-compilation-deny-list.
(native-comp-deferred-compilation-deny-list): Mark it obsolete.
2023-02-13 17:06:13 +01:00
Andrea Corallo
5d0912f144
Rename comp-enable-subr-trampolines into native-comp-enable-subr-trampolines
...
* src/data.c (Ffset): Rename comp-enable-subr-trampolines into
native-comp-enable-subr-trampolines.
* src/comp.c (syms_of_comp): Likewise.
* lisp/subr.el (comp-enable-subr-trampolines): Make
comp-enable-subr-trampolines obsolete.
* lisp/startup.el (native-comp-enable-subr-trampolines)
(normal-top-level): Rename comp-enable-subr-trampolines into
native-comp-enable-subr-trampolines.
* lisp/loadup.el (dump-mode): Likewise.
* lisp/emacs-lisp/comp.el (comp-subr-trampoline-install)
(comp--trampoline-abs-filename): Likewise.
2023-02-13 17:02:38 +01:00
Andrea Corallo
abfd00e5c0
* lisp/emacs-lisp/comp.el (native-comp-never-optimize-functions): Improve doc
2023-02-13 12:49:05 +01:00
Andrea Corallo
1795839bab
Support `comp-enable-subr-trampolines' as string value
...
* src/comp.c (syms_of_comp): Update `comp-enable-subr-trampolines'.
* lisp/emacs-lisp/comp.el (native-comp-never-optimize-functions)
(comp--trampoline-abs-filename): Support
`comp-enable-subr-trampolines' string value.
* src/data.c (Ffset): Use Vcomp_enable_subr_trampolines now.
2023-02-13 12:48:09 +01:00
Andrea Corallo
b6e2799aa1
* Some more `inhibit-native-compile' clean-up
...
* lisp/emacs-lisp/generate-lisp-file.el (generate-lisp-file-trailer):
Use `native-comp-deferred-compilation'.
2023-02-13 11:44:28 +01:00
Andrea Corallo
c0681cd347
Revert "Add new variable 'inhibit-native-compilation'"
...
This reverts commit 5fec9182db
.
2023-02-13 10:19:31 +01:00
Andrea Corallo
3969a34fa1
Revert "Rename to inhibit-automatic-native-compilation"
...
This reverts commit f97993ee66
.
2023-02-13 10:15:33 +01:00
Eli Zaretskii
56e8607dc9
Fix spurious errors on Windows when deleting temporary *.eln files
...
* lisp/emacs-lisp/comp.el (comp--native-compile): On MS-Windows,
ignore errors when deleting a temporary .eln file. (Bug#60996)
2023-01-29 09:44:53 +02:00
Eli Zaretskii
cae528457c
; Add 2023 to copyright years.
2023-01-01 05:31:12 -05:00
Andrea Corallo
e59216d3be
* Invoke spawed Emacs processes with '-Q' when native compiling (bug#60208)
...
* lisp/emacs-lisp/comp.el (comp-final): Invoke spawned Emacs with '-Q'.
(comp-run-async-workers): Likewise.
2022-12-21 23:29:33 +01:00
Eli Zaretskii
5a245bc786
Prevent Abort dialogs from async-compiling jobs on Windows
...
* lisp/emacs-lisp/comp.el (comp-run-async-workers): Disable Abort
dialog popping in the sub-processes that perform async
compilation, by passing w32-disable-abort-dialog=t on their
command line.
2022-12-17 20:35:11 +02:00
Eli Zaretskii
6fb9a03cbd
; Remove debugging leftover message
...
* lisp/emacs-lisp/comp.el (comp--native-compile): Remove
unnecessary call to 'message'. (Bug#59766)
2022-12-03 22:06:34 +02:00
Juanma Barranquero
2772ebe366
Do not prune native-compiled system directories (bug#59658)
...
* lisp/emacs-lisp/comp.el (native-compile-prune-cache):
Skip last directory in `native-comp-eln-load-path'.
2022-11-28 17:46:21 +01:00
Stefan Kangas
ba485eb949
; Fix typos
2022-11-18 16:02:19 +01:00
Stefan Kangas
93036209fa
; Fix typos (duplicate words)
2022-11-17 09:34:24 +01:00
Eli Zaretskii
df7ca69920
Set 'native-comp-debug' to zero on MS-Windows
...
* lisp/emacs-lisp/comp.el (native-comp-debug): Don't emit debug
symbols on MS-Windows. The default was originally made 1 because
without that, C backtraces on Windows would not show
natively-compiled functions correctly, or would even stop short of
reaching the topmost call frame. But that turned out to be due to
a bug in GDB, which was meanwhile fixed in GDB 12. So we can now
reset the value back to zero, and gain smaller *.eln files on
MS-Windows.
2022-10-29 18:59:04 +03:00
Alan Mackenzie
31e7b9c073
Fix the subr-arity returned by native compiled functions with lots of args
...
This fixes bug #58739 . Make subr-arity return, e.g., (12 . 12) rather than
(12 . many) for a function with a fixed number of arguments more than 8.
* lisp/emacs-lisp/comp.el (comp-prepare-args-for-top-level): Only return a cdr
of 'many when there are &rest arguments.
* src/eval.c (eval_sub): Also check for a fixed number of args over 8 when
using the nargs + *args calling convention.
(funcall_subr): Also check numargs <= 8 before using the fixed args calling
convention. Include the case numargs > 8 in the aMany calling convention.
* src/lisp.h (DEFUN): Amend the comment about MANY.
2022-10-29 13:21:39 +00:00
Andrea Corallo
5ad5b797f7
Set `comp-no-spawn' earlier using -no-comp-spawn
...
* src/emacs.c (standard_args): Add '-no-comp-spawn' cmd line option.
* lisp/startup.el (command-line): Parse '-no-comp-spawn' cmd line
option.
* lisp/emacs-lisp/comp.el (comp-run-async-workers, comp-final):
Use '-no-comp-spawn'.
2022-10-26 08:30:09 +02:00
Andrea Corallo
56c63ca21b
* Fix async native compilation (bug#58637)
...
* lisp/emacs-lisp/comp.el (comp--native-compile): Fix gate condition.
(comp-run-async-workers): Add assetion.
2022-10-19 22:21:03 +02:00
Andrea Corallo
1a8015b837
* Prevent potential native compilation infinite recursions
...
* lisp/emacs-lisp/comp.el (comp-no-spawn): New var.
(comp-subr-trampoline-install, comp-final, comp-run-async-workers)
(comp--native-compile): Update.
2022-10-18 10:42:13 +02:00
Stefan Kangas
eff4a4f49a
Improve native-compile-prune-cache messages
...
* lisp/emacs-lisp/comp.el (native-compile-prune-cache): Quote name of
pruned directory.
2022-10-17 15:28:25 +02:00
Stefan Kangas
40b734c500
Don't prune *.eln files in parent of eln-load-path
...
* lisp/emacs-lisp/comp.el (native-compile-prune-cache): Don't
prune *.eln files in parent directory of `native-comp-eln-load-path'.
* test/lisp/emacs-lisp/comp-tests.el
(test-native-compile-prune-cache/dont-delete-in-parent-of-cache):
New test.
2022-10-17 15:26:34 +02:00
Lars Ingebrigtsen
b9aff5fdb8
Fix spurious "Compilation finished" native-comp messages
...
* lisp/emacs-lisp/comp.el (native--compile-async): Don't start the
async compilation if we didn't add anything. This avoids spurious
"Compilation finished" messages in the *Async* buffer when it
turned out that all the files we considered nativecomping were
skipped.
2022-10-17 14:30:54 +02:00
Lars Ingebrigtsen
5176d00611
Avoid having the async compile log saying it's compiling loaddefs
...
* lisp/loadup.el (featurep): Define the hash table in nativecomp
builds (but not otherwise). A more natural place to define this
would be in comp.el, but comp.el isn't loaded yet when we load the
.elc file that updates comp--no-native-compile. We could change
the load order and move the definition to comp.el, though.
* lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Allow
inhibiting nativecomp earlier (bug#57627).
* lisp/emacs-lisp/comp.el (native-compile-async-skip-p): Use the data.
2022-10-17 10:48:20 +02:00
Andrea Corallo
3744720904
Add trampoline AOT compilation target (bug#58318)
...
* Makefile.in (trampolines): New target.
* lisp/Makefile.in (trampolines): Likewise.
* lisp/emacs-lisp/comp.el (comp-compile-all-trampolines): New
function.
2022-10-11 21:19:21 +02:00
Lars Ingebrigtsen
f97993ee66
Rename to inhibit-automatic-native-compilation
...
* src/comp.c (maybe_defer_native_compilation):
(syms_of_comp):
* lisp/subr.el (native-comp-deferred-compilation):
* lisp/startup.el (inhibit-native-compilation):
(normal-top-level):
* lisp/progmodes/elisp-mode.el (emacs-lisp-native-compile-and-load):
* lisp/emacs-lisp/comp.el (comp-trampoline-compile):
* etc/NEWS:
* doc/lispref/compile.texi (Native-Compilation Variables): Rename
inhibit-native-compilation to inhibit-automatic-native-compilation.
2022-10-03 19:50:03 +02:00
Lars Ingebrigtsen
5fec9182db
Add new variable 'inhibit-native-compilation'
...
* doc/lispref/compile.texi (Native-Compilation Variables):
Document it.
* lisp/startup.el (normal-top-level): Set
inhibit-native-compilation from environment variable.
* lisp/subr.el (native-comp-deferred-compilation): Make obsolete.
* lisp/emacs-lisp/comp.el (comp-trampoline-compile): Don't write
trampolines to disk.
* lisp/progmodes/elisp-mode.el
(emacs-lisp-native-compile-and-load): Adjust.
* src/comp.c (syms_of_comp): New variable
inhibit-native-compilation.
(maybe_defer_native_compilation): Use it.
2022-10-03 15:26:13 +02:00
Stefan Kangas
9b14e312f4
Merge from origin/emacs-28
...
478b786d5a
; * doc/lispref/windows.texi (Window Hooks): Fix a typo (b...
5085351645
* lisp/text-modes/tex-mode.el (tex-mode): Fix AUCTeX regre...
ee6f8598ca
Add vc-annotate-switches to manual
616dcf27e5
; Fix typos in Lisp symbols
5405852541
Remove mention of non-existent `annotate-switches'
191505b8a3
Mention that src/macuvs.h sometimes needs committing
10373c4b68
; More comment fixes in font.h (bug#57935)
c2595b8dcc
; * src/font.h (struct font_driver): Comment fix.
97b928ce09
MacOS ld warning from native compilation (bug#57849)
2022-09-21 10:25:06 +02:00
Mattias Engdegård
60102016e4
Abolish max-specpdl-size (bug#57911)
...
The max-lisp-eval-depth limit is sufficient to prevent unbounded stack
growth including the specbind stack; simplify matters for the user by
not having them to worry about two different limits. This change
turns max-specpdl-size into a harmless variable with no effects,
to keep existing code happy.
* lisp/subr.el (max-specpdl-size):
Define as an ordinary (but obsolete) dynamic variable.
* admin/grammars/Makefile.in:
* doc/lispintro/emacs-lisp-intro.texi (Loops & Recursion):
* doc/lispref/control.texi (Cleanups):
* doc/lispref/edebug.texi (Checking Whether to Stop):
* doc/lispref/eval.texi (Eval):
* doc/lispref/variables.texi (Local Variables):
* doc/misc/calc.texi (Recursion Depth):
Update documentation.
* etc/NEWS: Announce.
* src/eval.c
(FletX): Use safe iteration to guard against circular bindings list.
(syms_of_eval): Remove old max-specpdl-size definition.
(init_eval_once, restore_stack_limits, call_debugger)
(signal_or_quit, grow_specpdl_allocation):
* leim/Makefile.in:
* lisp/Makefile.in:
* lisp/calc/calc-stuff.el (calc-more-recursion-depth)
(calc-less-recursion-depth):
* lisp/calc/calc.el (calc-do):
* lisp/cedet/semantic/ede-grammar.el (ede-proj-makefile-insert-rules):
* lisp/cedet/semantic/grammar.el (semantic-grammar-batch-build-one-package):
* lisp/cus-start.el (standard):
* lisp/emacs-lisp/comp.el (comp--native-compile):
* lisp/emacs-lisp/edebug.el (edebug-max-depth):
(edebug-read-and-maybe-wrap-form, edebug-default-enter):
* lisp/emacs-lisp/regexp-opt.el (regexp-opt):
* lisp/eshell/esh-mode.el (eshell-mode):
* lisp/loadup.el (max-specpdl-size):
* lisp/mh-e/mh-e.el (mh-invisible-headers):
* lisp/net/shr.el (shr-insert-document, shr-descend):
* lisp/play/hanoi.el (hanoi-internal):
* lisp/progmodes/cperl-mode.el:
* src/fileio.c (Fdo_auto_save):
Remove references to and modifications of max-specpdl-size.
2022-09-19 19:30:03 +02:00
Gerd Möllmann
97b928ce09
MacOS ld warning from native compilation (bug#57849)
...
* lisp/emacs-lisp/comp.el (native-comp-driver-options): Add "-Wl,-w"
on Darwin systems.
* etc/NEWS: Describe change.
2022-09-19 07:14:58 +02:00
Stefan Kangas
5c8b76fc87
Merge from origin/emacs-28
...
5713c730f2
Update to Org 9.5.5
aad38d6010
* lisp/emacs-lisp/comp.el (comp-run-async-workers): Fail m...
2022-09-05 06:30:32 +02:00
Stefan Monnier
aad38d6010
* lisp/emacs-lisp/comp.el (comp-run-async-workers): Fail more gracefully
...
Otherwise Emacs may fail to start if it can't find a writable
`~/.emacs.d/eln-cache` directory.
Fixes bug#57562. See also Debian's bug #1017739 .
2022-09-03 15:14:58 -04:00
Eli Zaretskii
dcfe3314cd
Teach 'max-char' about the Unicode code range
...
* src/character.c (Fmax_char): Accept an optional argument
UNICODE, and, if non-nil, return the maximum codepoint defined by
Unicode.
* lisp/emacs-lisp/comp.el (comp-known-type-specifiers): Update the
signature of 'max-char'.
* etc/NEWS:
* doc/lispref/nonascii.texi (Character Codes): Update the
documentation of 'max-char'.
2022-09-03 13:45:53 +03:00
Andrea Corallo
a5e36575ae
* lisp/emacs-lisp/comp.el (comp-known-type-specifiers): Fix some type spec
2022-08-22 10:29:18 +02:00
Mattias Engdegård
1ad0d60740
Fix string-to-syntax signature in comp-known-type-specifiers
...
* lisp/emacs-lisp/comp.el (comp-known-type-specifiers):
`string-to-syntax` can return nil.
2022-08-18 17:25:41 +02:00
Andrea Corallo
67ec994180
* lisp/emacs-lisp/comp.el (comp-known-type-specifiers): Fix some type
2022-08-18 17:11:59 +02:00
Gregory Heytings
9d8a6c8283
Fix the bytecode incompatibility due to the change to 'narrow-to-region'.
...
* src/editfns.c (narrow_to_region_internal): New function, which
contains the body previously in 'Fnarrow_to_region' but accepts
a third argument.
(Fnarrow_to_region): Use the new function. Update the docstring.
(Fwiden): Update the docstring.
* src/lisp.h: Prototype of the new function.
* src/xdisp.c (handle_fontified_prop): Use the new function instead
of 'Fnarrow_to_region'.
* src/process.c (Finternal_default_process_filter):
* src/lread.c (readevalloop): Remove the third argument to
'Fnarrow_to_region'.
* src/bytecode.c (exec_byte_code):
* lisp/emacs-lisp/comp.el (comp-limplify-lap-inst):
* lisp/emacs-lisp/bytecomp.el: Restore the statu quo ante.
* etc/NEWS: Remove the entry about the new optional argument.
* doc/lispref/positions.texi (Narrowing): Update the documentation.
2022-08-01 21:11:49 +02:00
Gerd Möllmann
9e6eee36b5
Fix native compiler handling of narrow-to-region
...
* lisp/emacs-lisp/comp.el (comp-limplify-lap-inst): Use auto for
byte-narrow-to-region.
2022-07-30 17:32:04 +02:00
Gerd Möllmann
9ebd0455f3
Adapt native compiler to change in narrow-to-region
...
* lisp/emacs-lisp/comp.el (comp-limplify-lap-inst): Add third
argument nil for narrow-to-region.
2022-07-29 17:28:25 +02:00
Lars Ingebrigtsen
f268cdc185
Fix typo in error message in native-compile-prune-cache
...
* lisp/emacs-lisp/comp.el (native-compile-prune-cache): Fix typo
(bug#56713).
2022-07-23 00:01:00 +02:00
Lars Ingebrigtsen
963c8c35c3
Give a better error message in native-compile-prune-cache
...
* lisp/emacs-lisp/comp.el (native-compile-prune-cache): Give a
better error message in non-nativecomp builds.
2022-07-22 21:55:23 +02:00
Stefan Kangas
c516b49daa
Merge from origin/emacs-28
...
9db6817d63
Remove uneffective test
7af88de410
Mark async worker tmp file as utf-8-emacs-unix (bug#48029)
# Conflicts:
# test/src/comp-resources/comp-test-45603.el
# test/src/comp-tests.el
2022-07-14 11:56:56 +02:00
Andrea Corallo
7af88de410
Mark async worker tmp file as utf-8-emacs-unix (bug#48029)
...
* lisp/emacs-lisp/comp.el (comp-final): Mark async worker tmp file
as utf-8.
* test/src/comp-tests.el (48029-1): New test.
* test/src/comp-resources/comp-test-funcs.el
(comp-test-48029-nonascii-žžž-f): New function.
2022-07-13 15:19:27 +02:00
Stefan Kangas
a837c59d9e
Merge from origin/emacs-28
...
9183d1672c
; * etc/PROBLEMS: Give a URL for bug#50666.
1f508a8b6f
etc/PROBLEMS: Describe issues with native compilation on C...
84a5d47125
; Fix last change
0461021893
; * lisp/emacs-lisp/comp.el (native-comp-speed): Explain t...
876317271b
* lisp/find-dired.el (find-dired): Doc fix; add crossrefer...
2022-07-12 06:30:35 +02:00
Eli Zaretskii
0461021893
; * lisp/emacs-lisp/comp.el (native-comp-speed): Explain the -1 value.
2022-07-11 16:48:24 +03:00
Stefan Kangas
9d866a1f8d
Make some defcustom types more restrictive
...
* lisp/abbrev.el (abbrev-suggest-hint-threshold):
* lisp/bookmark.el (bookmark-bmenu-file-column)
(bookmark-menu-length):
* lisp/buff-menu.el (Buffer-menu-size-width)
(Buffer-menu-mode-width):
* lisp/calendar/calendar.el (calendar-week-start-day)
(calendar-intermonth-spacing, calendar-column-width)
(calendar-day-digit-width):
* lisp/calc/calc.el (calc-undo-length):
* lisp/calendar/timeclock.el (timeclock-workday):
* lisp/comint.el (comint-buffer-maximum-size)
(comint-input-ring-size):
* lisp/doc-view.el (doc-view-resolution, doc-view-image-width):
* lisp/emacs-lisp/bytecomp.el (byte-compile-docstring-max-column):
* lisp/emacs-lisp/comp.el (native-comp-debug)
(native-comp-verbose, native-comp-async-jobs-number):
* lisp/emacs-lisp/package.el (package-name-column-width)
(package-version-column-width, package-status-column-width)
(package-archive-column-width):
* lisp/eshell/esh-mode.el (eshell-buffer-maximum-lines):
* lisp/frame.el (blink-cursor-blinks):
* lisp/info.el (Info-breadcrumbs-depth):
* lisp/jit-lock.el (jit-lock-chunk-size):
* lisp/kmacro.el (kmacro-ring-max):
* lisp/menu-bar.el (yank-menu-length, yank-menu-max-items):
* lisp/midnight.el (clean-buffer-list-delay-general)
(clean-buffer-list-delay-special):
* lisp/net/dictionary.el (dictionary-port)
(dictionary-proxy-port):
* lisp/net/ldap.el (ldap-default-port):
* lisp/net/pop3.el (pop3-port, pop3-stream-length):
* lisp/net/rcirc.el (rcirc-default-port):
* lisp/net/sieve-manage.el (sieve-manage-default-port):
* lisp/play/spook.el (spook-phrase-default-count):
* lisp/play/tetris.el (tetris-buffer-width)
(tetris-buffer-height, tetris-width, tetris-height)
(tetris-top-left-x, tetris-top-left-y):
* lisp/profiler.el (profiler-sampling-interval):
* lisp/progmodes/sql.el (sql-port):
* lisp/recentf.el (recentf-max-menu-items):
* lisp/strokes.el (strokes-grid-resolution):
* lisp/tab-bar.el (tab-bar-tab-name-truncated-max):
* lisp/term/xterm.el (xterm-max-cut-length):
* lisp/time.el (display-time-interval, world-clock-timer-second):
* lisp/url/url-cache.el (url-cache-expire-time):
* lisp/url/url-cookie.el (url-cookie-save-interval):
* lisp/url/url-history.el (url-history-save-interval):
* lisp/url/url-queue.el (url-queue-parallel-processes)
(url-queue-timeout):
* lisp/url/url-vars.el (url-max-password-attempts)
(url-max-redirections):
* lisp/vc/emerge.el (emerge-min-visible-lines):
* lisp/vc/vc.el (vc-log-show-limit):
* lisp/window.el (window-min-height, window-min-width):
* lisp/winner.el (winner-ring-size): Use :type natnum.
* lisp/savehist.el (savehist-file-modes): Fix setting to nil value and
use :type natnum.
2022-07-05 18:33:29 +02:00