summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/comp.el
Commit message (Collapse)AuthorAgeFilesLines
* * lisp/emacs-lisp/comp.el (comp-emit-set-call-subr): Improve 263d6c38539Andrea Corallo2023-03-211-1/+1
|
* Comp fix calls to redefined primtives with op-bytecode (bug#61917)Andrea Corallo2023-03-201-11/+19
| | | | | | * lisp/emacs-lisp/comp.el (comp-emit-set-call-subr): Fix compilation of calls to redefined primtives with dedicated op-bytecode. * test/src/comp-tests.el (61917-1): New test.
* * Make sure `default-directory' exists before spawning processes (bug#62004)Andrea Corallo2023-03-081-1/+3
| | | | | * lisp/emacs-lisp/comp.el (comp-final, comp-run-async-workers): Bind `default-directory' to `invocation-directory'.
* * lisp/emacs-lisp/comp.el (comp-prettyformat-insn): Fix (bug#61917)Andrea Corallo2023-03-061-4/+6
|
* ; Minor fix of last changeEli Zaretskii2023-03-051-1/+1
| | | | | * lisp/emacs-lisp/comp.el (comp-subr-trampoline-install): Fix wording. (Bug#61880)
* * Warn when certain primitives are redefined (bug#61880)Andrea Corallo2023-03-051-0/+11
| | | | | | * lisp/emacs-lisp/comp.el (comp-warn-primitives): New constant. (comp-subr-trampoline-install): Warn when a sensitive primitive is being redefined.
* * lisp/emacs-lisp/comp.el (comp--trampoline-abs-filename): Improve 5d0b45cd67bAndrea Corallo2023-02-211-4/+2
|
* Make the native compiler always use `make-temp-file' for temporary filesAndrea Corallo2023-02-201-2/+2
| | | | | | | * 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.
* * Fix `native-comp-enable-subr-trampolines' semanticAndrea Corallo2023-02-181-1/+2
| | | | | | * lisp/emacs-lisp/comp.el (comp--trampoline-abs-filename): Interpret `native-comp-enable-subr-trampolines' relative to `invocation-directory'.
* ; Improve and update documentation of native compilationEli Zaretskii2023-02-171-3/+2
| | | | | | | | | | | | * 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'.
* * Generate trampolines in a temporary directory if no other option is viableAndrea Corallo2023-02-141-8/+12
| | | | | * lisp/emacs-lisp/comp.el (comp--trampoline-abs-filename): Use temporary file if no other option is viable.
* Rename native-comp-deferred-compilation-deny-listAndrea Corallo2023-02-131-3/+7
| | | | | | | | * 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.
* Rename comp-enable-subr-trampolines into native-comp-enable-subr-trampolinesAndrea Corallo2023-02-131-3/+3
| | | | | | | | | | | | | | | | | | | * 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.
* * lisp/emacs-lisp/comp.el (native-comp-never-optimize-functions): Improve docAndrea Corallo2023-02-131-1/+6
|
* Support `comp-enable-subr-trampolines' as string valueAndrea Corallo2023-02-131-16/+23
| | | | | | | | | | * 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.
* * Some more `inhibit-native-compile' clean-upAndrea Corallo2023-02-131-3/+1
| | | | | * lisp/emacs-lisp/generate-lisp-file.el (generate-lisp-file-trailer): Use `native-comp-deferred-compilation'.
* Revert "Add new variable 'inhibit-native-compilation'"Andrea Corallo2023-02-131-19/+16
| | | | This reverts commit 5fec9182dbeffa88cef6651d8c798ef9665d6681.
* Revert "Rename to inhibit-automatic-native-compilation"Andrea Corallo2023-02-131-1/+1
| | | | This reverts commit f97993ee667f9be7589825f3a4fbc095d6944ec6.
* Fix spurious errors on Windows when deleting temporary *.eln filesEli Zaretskii2023-01-291-2/+5
| | | | | * lisp/emacs-lisp/comp.el (comp--native-compile): On MS-Windows, ignore errors when deleting a temporary .eln file. (Bug#60996)
* ; Add 2023 to copyright years.Eli Zaretskii2023-01-011-1/+1
|
* * Invoke spawed Emacs processes with '-Q' when native compiling (bug#60208)Andrea Corallo2022-12-211-2/+2
| | | | | * lisp/emacs-lisp/comp.el (comp-final): Invoke spawned Emacs with '-Q'. (comp-run-async-workers): Likewise.
* Prevent Abort dialogs from async-compiling jobs on WindowsEli Zaretskii2022-12-171-2/+5
| | | | | | | * 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.
* ; Remove debugging leftover messageEli Zaretskii2022-12-031-1/+0
| | | | | * lisp/emacs-lisp/comp.el (comp--native-compile): Remove unnecessary call to 'message'. (Bug#59766)
* Do not prune native-compiled system directories (bug#59658)Juanma Barranquero2022-11-281-1/+3
| | | | | * lisp/emacs-lisp/comp.el (native-compile-prune-cache): Skip last directory in `native-comp-eln-load-path'.
* ; Fix typosStefan Kangas2022-11-181-1/+1
|
* ; Fix typos (duplicate words)Stefan Kangas2022-11-171-1/+1
|
* Set 'native-comp-debug' to zero on MS-WindowsEli Zaretskii2022-10-291-2/+2
| | | | | | | | | | | * 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.
* Fix the subr-arity returned by native compiled functions with lots of argsAlan Mackenzie2022-10-291-3/+4
| | | | | | | | | | | | | | | 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.
* Set `comp-no-spawn' earlier using -no-comp-spawnAndrea Corallo2022-10-261-5/+5
| | | | | | | | * 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'.
* * Fix async native compilation (bug#58637)Andrea Corallo2022-10-191-1/+2
| | | | | * lisp/emacs-lisp/comp.el (comp--native-compile): Fix gate condition. (comp-run-async-workers): Add assetion.
* * Prevent potential native compilation infinite recursionsAndrea Corallo2022-10-181-83/+85
| | | | | | * lisp/emacs-lisp/comp.el (comp-no-spawn): New var. (comp-subr-trampoline-install, comp-final, comp-run-async-workers) (comp--native-compile): Update.
* Improve native-compile-prune-cache messagesStefan Kangas2022-10-171-1/+1
| | | | | * lisp/emacs-lisp/comp.el (native-compile-prune-cache): Quote name of pruned directory.
* Don't prune *.eln files in parent of eln-load-pathStefan Kangas2022-10-171-1/+3
| | | | | | | | * 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.
* Fix spurious "Compilation finished" native-comp messagesLars Ingebrigtsen2022-10-171-3/+8
| | | | | | | | * 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.
* Avoid having the async compile log saying it's compiling loaddefsLars Ingebrigtsen2022-10-171-0/+1
| | | | | | | | | | | | | * 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.
* Add trampoline AOT compilation target (bug#58318)Andrea Corallo2022-10-111-0/+11
| | | | | | | * Makefile.in (trampolines): New target. * lisp/Makefile.in (trampolines): Likewise. * lisp/emacs-lisp/comp.el (comp-compile-all-trampolines): New function.
* Rename to inhibit-automatic-native-compilationLars Ingebrigtsen2022-10-031-1/+1
| | | | | | | | | | | | | * 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.
* Add new variable 'inhibit-native-compilation'Lars Ingebrigtsen2022-10-031-16/+20
| | | | | | | | | | | | | | | | | | | | * 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.
* Merge from origin/emacs-28Stefan Kangas2022-09-211-2/+3
|\ | | | | | | | | | | | | | | | | | | | | | | 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)
| * MacOS ld warning from native compilation (bug#57849)Gerd Möllmann2022-09-191-2/+3
| | | | | | | | | | | | * lisp/emacs-lisp/comp.el (native-comp-driver-options): Add "-Wl,-w" on Darwin systems. * etc/NEWS: Describe change.
* | Abolish max-specpdl-size (bug#57911)Mattias Engdegård2022-09-191-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Merge from origin/emacs-28Stefan Kangas2022-09-051-2/+5
|\| | | | | | | | | 5713c730f2 Update to Org 9.5.5 aad38d6010 * lisp/emacs-lisp/comp.el (comp-run-async-workers): Fail m...
| * * lisp/emacs-lisp/comp.el (comp-run-async-workers): Fail more gracefullyStefan Monnier2022-09-031-2/+5
| | | | | | | | | | | | 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.
* | Teach 'max-char' about the Unicode code rangeEli Zaretskii2022-09-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | * 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'.
* | * lisp/emacs-lisp/comp.el (comp-known-type-specifiers): Fix some type specAndrea Corallo2022-08-221-6/+16
| |
* | Fix string-to-syntax signature in comp-known-type-specifiersMattias Engdegård2022-08-181-1/+1
| | | | | | | | | | * lisp/emacs-lisp/comp.el (comp-known-type-specifiers): `string-to-syntax` can return nil.
* | * lisp/emacs-lisp/comp.el (comp-known-type-specifiers): Fix some typeAndrea Corallo2022-08-181-10/+10
| |
* | Fix the bytecode incompatibility due to the change to 'narrow-to-region'.Gregory Heytings2022-08-011-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* | Fix native compiler handling of narrow-to-regionGerd Möllmann2022-07-301-5/+1
| | | | | | | | | | * lisp/emacs-lisp/comp.el (comp-limplify-lap-inst): Use auto for byte-narrow-to-region.
* | Adapt native compiler to change in narrow-to-regionGerd Möllmann2022-07-291-1/+2
| | | | | | | | | | * lisp/emacs-lisp/comp.el (comp-limplify-lap-inst): Add third argument nil for narrow-to-region.