aboutsummaryrefslogtreecommitdiffstats
path: root/src/comp.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Rename comp-deferred-compilationAndrea Corallo2021-05-111-3/+4
| | | | | | | | * lisp/progmodes/elisp-mode.el (emacs-lisp-native-compile-and-load): Rename comp-deferred-compilation -> native-comp-deferred-compilation. * src/comp.c (maybe_defer_native_compilation, syms_of_comp): Likewise.
* Rename comp-eln-load-path → native-comp-eln-load-pathAndrea Corallo2021-05-061-7/+7
| | | | | | | | | | | | * src/comp.c (Fcomp_el_to_eln_filename): Rename comp-eln-load-path → native-comp-eln-load-path. * src/lread.c (maybe_swap_for_eln): Likewise. * lisp/startup.el (native-comp-eln-load-path) (normal-top-level): Likewise. * lisp/emacs-lisp/comp.el (comp-spill-lap-function, comp-final) (comp-eln-load-path-eff, comp-trampoline-compile) (comp-clean-up-stale-eln, comp-run-async-workers) (comp-lookup-eln, batch-byte-native-compile-for-bootstrap): Likewise.
* Rename comp-warning-on-missing-sourceAndrea Corallo2021-05-061-1/+2
| | | | | | | | | * src/lread.c (maybe_swap_for_eln): Rename comp-warning-on-missing-source → native-comp-warning-on-missing-source. * src/comp.c (syms_of_comp): Likewise. * lisp/emacs-lisp/comp.el (native-comp-warning-on-missing-source): Likewise.
* Rename comp-native-driver-options → native-comp-driver-optionsAndrea Corallo2021-05-061-2/+2
| | | | | | | | | * src/comp.c (add_driver_options, syms_of_comp): Rename comp-native-driver-options → native-comp-driver-options. * lisp/emacs-lisp/comp.el (native-comp-driver-options) (comp-ctxt, comp-spill-lap-function, comp-final) (comp-run-async-workers): Likewise. * lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Likewise.
* Rename comp-debug -> native-comp-debugAndrea Corallo2021-05-061-2/+2
| | | | | | | | | * src/comp.c (emit_ctxt_code, syms_of_comp): Rename comp-debug -> native-comp-debug. * lisp/emacs-lisp/comp.el (native-comp-debug, comp-ctxt) (comp-spill-lap-function, comp-run-async-workers): Likewise. * lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Likewise. * test/src/comp-tests.el (comp-tests-bootstrap): Likewise.
* Rename comp-speed -> native-comp-speedAndrea Corallo2021-05-061-3/+3
| | | | | | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Rename comp-speed -> native-comp-speed. * lisp/emacs-lisp/comp.el (native-comp-speed, comp-ctxt, comp-func, comp-spill-lap-function, comp-trampoline-compile, comp-run-async-workers): Likewise. * src/comp.c (emit_ctxt_code, load_comp_unit, syms_of_comp): Likewise. * test/src/comp-tests.el (comp-tests-tco, comp-tests-fw-prop-1) (comp-tests-check-ret-type-spec, comp-tests-pure): Likewise.
* Rename feature `nativecomp' into `native-compile'Andrea Corallo2021-05-051-1/+1
| | | | | | | | | | | | | | | * test/src/comp-tests.el : Rename feature `nativecomp' into `native-compile'. * test/lisp/help-fns-tests.el (help-fns-test-lisp-defun): Likewise. * src/comp.c (syms_of_comp): Likewise. * lisp/startup.el (normal-top-level): Likewise. * lisp/loadup.el: Likewise. * lisp/help.el (help-function-arglist): Likewise. * lisp/emacs-lisp/package.el (package--native-compile-async) (package--delete-directory): Likewise. * lisp/emacs-lisp/nadvice.el (advice--add-function): Likewise. * lisp/emacs-lisp/comp.el (comp-ensure-native-compiler): Likewise. * lisp/emacs-lisp/advice.el (ad-add-advice): Likewise.
* ; * src/comp.c: Fix typos.Eli Zaretskii2021-04-271-2/+2
|
* ; Fix typosStefan Kangas2021-04-271-3/+3
|
* * src/comp.c (fixup_eln_load_path): Simplify code.Eli Zaretskii2021-04-181-7/+5
|
* Fix loading *.eln files when Emacs is installed via symlinksEli Zaretskii2021-04-171-17/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/emacs.c (real_filename, set_invocation_vars) (init_vars_for_load): Functions deleted; callers adjusted. (init_cmdargs): Put back all the code which was extracted into set_invocation_vars. (load_pdump_find_executable): Make sure the return value has any symlinks in it expanded. (load_pdump): Accept only 2 arguments, not 3. Determine both the file name of the Emacs executable and of the dump file in synchronized manner, so that if we decided to look for the dump file in its hardcoded installation directory, the directory of the Emacs executable will also be where we expect it to be installed. Pass only 2 arguments to pdumper_load. (Bug#47800) (Bug#44128) * src/pdumper.c (dump_do_dump_relocation): Use emacs_execdir instead of Vinvocation_directory to produce absolute file names of *.eln files that are recorded in the pdumper file. Pass the full .eln file name to fixup_eln_load_path. (pdumper_set_emacs_execdir) [HAVE_NATIVE_COMP]: New function. (pdumper_load) [HAVE_NATIVE_COMP]: Call pdumper_set_emacs_execdir. * src/comp.c (fixup_eln_load_path): Use Fsubstring_no_properties instead of Fsubstring. No need to cons a file name, as the caller already did that. Use explicit const string to avoid "magic" values. * lisp/startup.el (normal-top-level): Use expand-file-name instead of concat. Decode comp-eln-load-path and expand-file-name its members.
* * Introduce `comp-file-preloaded-p'Andrea Corallo2021-04-051-7/+13
| | | | | * src/comp.c (syms_of_comp): Define `comp-file-preloaded-p'. (Fcomp_el_to_eln_filename): Account for `comp-file-preloaded-p'.
* * src/comp.c (fixup_eln_load_path): Fix parameter name.Andrea Corallo2021-04-041-2/+2
|
* * src/comp.c (Fcomp_el_to_eln_filename): Fix doc.Andrea Corallo2021-04-041-1/+2
|
* Output native compiled preloaded files into the 'preloaded' subfolderAndrea Corallo2021-04-041-7/+22
| | | | | | | | | * src/comp.c (fixup_eln_load_path): Account the fact that the file can be dumped in the 'preloaded' subfolder. * lisp/loadup.el: Likewise. * src/lread.c (maybe_swap_for_eln1): New function. (maybe_swap_for_eln): Handle 'preloaded' subfolder. * src/Makefile.in (LISP_PRELOADED): Export preloaded files.
* Issue a warning when eln look-up fails due to missing .el source file.Andrea Corallo2021-04-011-1/+2
| | | | | | | | | * lisp/emacs-lisp/comp.el (comp-warning-on-missing-source): New customize. * src/lread.c (maybe_swap_for_eln): Issue a warning when eln look-up fails due to missing .el source file. * src/comp.c (syms_of_comp): Define 'Qcomp_warning_on_missing_source'.
* * src/comp.c (Fcomp__compile_ctxt_to_file): Fix debug level 1.Eli Zaretskii2021-03-311-1/+1
|
* Rework native compilation `comp-debug' (bug#46495)Andrea Corallo2021-03-311-2/+2
| | | | | | | * lisp/emacs-lisp/comp.el (comp-debug): Update docstring and move default on Windows systems from 0 to 1. * src/comp.c (Fcomp__compile_ctxt_to_file): Tweak debug levels.
* Do not defer compilation when bytecode is explicitly requested (bug#46617)Andrea Corallo2021-03-311-1/+9
| | | | | | | | | | | * src/comp.c (maybe_defer_native_compilation): Check if the file is registered in 'V_comp_no_native_file_h'. (syms_of_comp): 'V_comp_no_native_file_h' new global. * src/lread.c (maybe_swap_for_eln): Register files in 'V_comp_no_native_file_h'. * lisp/faces.el (tty-run-terminal-initialization): Do not explicitly load .elc file to not exclude .eln being loaded in place.
* Improve two native compiler related docstrings.Andrea Corallo2021-03-241-0/+2
| | | | | * lisp/emacs-lisp/comp.el (comp-eln-load-path-eff): Improve docstring. * src/comp.c (comp-eln-load-path): Likewise.
* ; * src/comp.c (Fcomp_el_to_eln_filename): Improve docstring.Andrea Corallo2021-03-211-1/+2
|
* Prevent unnecessary multiple .el hashing in 'maybe_swap_for_eln'Andrea Corallo2021-03-211-6/+15
| | | | | | | | | * src/comp.c (Fcomp_el_to_eln_rel_filename): New function. (Fcomp_el_to_eln_filename): Make use of. (syms_of_comp): Register 'Scomp_el_to_eln_rel_filename'. * src/lread.c (maybe_swap_for_eln): Make use of 'Fcomp_el_to_eln_rel_filename' to hash prevent unnecessary multiple hashing.
* Prefer expand-file-name to concat in native-compilation codeEli Zaretskii2021-03-151-4/+4
| | | | | | | * lisp/emacs-lisp/comp.el (comp-eln-load-path-eff): * src/comp.c (Fcomp_el_to_eln_filename) (eln_load_path_final_clean_up): Prefer expand-file-name to concat. (Bug#43725)
* Don't call setjmp through a function pointer on Windows (bug#47067)Pip Cet2021-03-141-12/+14
| | | | | | | * src/comp.c (ABI_VERSION): Bump. (emit_setjmp): Call setjmp directly. (declare_runtime_imported_funcs): Remove setjmp. (helper_link_table): Remove entry for setjmp.
* Fix hang due to failure to clean up *.eln.old files at exitEli Zaretskii2021-03-141-1/+1
| | | | | | * src/comp.c (eln_load_path_final_clean_up): Call internal_delete_file, not Fdelete_file, to ignore any errors. (Bug#46972)
* * src/comp.c (ABI_VERSION): Bump following-up 380ba045c4.Andrea Corallo2021-03-091-1/+1
|
* * Fix comp unit type decl in eln files to fix GC crash (bug#46256)Pip Cet2021-03-091-1/+1
| | | | | * src/comp.c (emit_ctxt_code): Allocate comp_unit as a Lisp_Object, not a pointer to pointer to Lisp_Object.
* Zero stale pointer when unloading comp units (bug#46256)Pip Cet2021-03-091-0/+14
| | | | | * src/alloc.c (cleanup_vector): Call unload_comp_unit. * src/comp.c (unload_comp_unit): New function.
* * Handle `comp-native-driver-options' both as file-local both as globalAndrea Corallo2021-03-071-3/+16
| | | | | | | * src/comp.c (add_driver_options): Throw an error if `comp-native-driver-options' is set globally but 'gcc_jit_context_add_driver_option' is not available, ignore for the file-local case.
* ; * src/comp.c (load_comp_unit): Fix a comment.Andrea Corallo2021-03-071-1/+1
|
* Allow for `comp-native-driver-options' to work as a file-local variable.Andrea Corallo2021-03-071-1/+3
|
* * Work around GCC PR99126 on all libgccjit < 11Andrea Corallo2021-03-071-1/+2
| | | | | * src/comp.c (Fcomp__compile_ctxt_to_file): Work around GCC PR99126 on all libgccjit < 11.
* Fix encoding of file names in comp.cEli Zaretskii2021-03-071-1/+6
| | | | | * src/comp.c (Fcomp__compile_ctxt_to_file) [WINDOWSNT]: Fix encoding of file names passed to libgccjit.
* ; * src/comp.c (Fcomp__compile_ctxt_to_file) [WINDOWSNT]: Fix last change.Eli Zaretskii2021-03-071-0/+1
|
* Fix libgccjit PROGNAME on MS-WindowsEli Zaretskii2021-03-071-0/+30
| | | | | | | | * src/comp.c [WINDOWSNT]: Import gcc_jit_context_set_str_option. (init_gccjit_functions): Load gcc_jit_context_set_str_option. (gcc_jit_context_set_str_option) [WINDOWSNT]: New macro. (Fcomp__compile_ctxt_to_file) [WINDOWSNT]: Pass the actual name of the libgccjit DLL to the library, to be used as PROGNAME.
* Fix some unsafe uses of SSDATA in comp.cEli Zaretskii2021-03-051-12/+21
| | | | | | | | | | * src/comp.c (comp_hash_source_file) (Fcomp__compile_ctxt_to_file, Fnative_elisp_load): Encode file names before passing them to library APIs. (Fcomp__compile_ctxt_to_file): use emacs_fopen instead of fopen. (declare_lex_function): Avoid keeping a 'char *' pointer around while calling Lisp, which could trigger GC, which could relocate string data.
* * Harden `comp-abi-hash' computationAndrea Corallo2021-03-051-1/+12
| | | | | | | | | Account for subr arity in `comp-abi-hash' computation as that's part of the ABI exposed to .eln files. * src/comp.c (Fcomp__subr_signature): New support function. (hash_native_abi): Make use of. (syms_of_comp): Register 'Scomp__subr_signature'.
* * src/comp.c (hash_native_abi): Account for `system-configuraton-options'.Andrea Corallo2021-03-041-1/+2
|
* Don't call _setjmp through a function pointer (Bug#46824)Pip Cet2021-03-031-7/+17
| | | | | | | | | * src/comp.c (helper_link_table): Don't include SETJMP except on Windows. (emit_setjmp): Don't use function pointers except on Windows. (declare_runtime_imported_funcs): Don't import SETJMP at runtime. (ABI_VERSION): Bump. * test/src/comp-tests.el (46824-1): New test. * test/src/comp-test-funcs.el (comp-test-46824-1-f): New function.
* * src/comp.c (return_nil): Make it not a nested function.Andrea Corallo2021-03-031-2/+8
|
* Fix compilation warnings in --with-wide-int build on WindowsEli Zaretskii2021-03-031-3/+9
| | | | | | | | | | * src/comp.c (emit_rvalue_from_emacs_uint) (emit_rvalue_from_lisp_word_tag): Fix comparison of unsigned values. (gcc_jit_context_new_rvalue_from_ptr): Define only if LISP_WORDS_ARE_POINTERS, to avoid compilation warning. (init_gccjit_functions): Load gcc_jit_context_new_rvalue_from_ptr only if LISP_WORDS_ARE_POINTERS.
* Migrate and rename a bunch of functions from comp.el to comp-cstr.elAndrea Corallo2021-02-281-2/+2
| | | | | | | | | | | | | | * lisp/emacs-lisp/comp-cstr.el (comp-cstr-imm-vld-p) (comp-cstr-imm, comp-cstr-fixnum-p, comp-cstr-symbol-p) (comp-cstr-cons-p): Move and rename from 'comp.el'. * lisp/emacs-lisp/comp.el (comp-mvar-type-hint-match-p) (make-comp-mvar, comp-emit-assume, comp-fwprop-prologue) (comp-function-foldable-p, comp-function-call-maybe-fold) (comp-fwprop-call, comp-fwprop-insn, comp-call-optim-func) (comp-compute-function-type): Update for renamed functions. * src/comp.c (emit_mvar_rval): Likewise. * test/src/comp-tests.el (comp-tests-mentioned-p-1) (comp-tests-cond-rw-checker-val): Likewise.
* * Canonicalize filenames on Windows before hashing (bug#46256)Andrea Corallo2021-02-261-2/+9
| | | | | * src/comp.c (Fcomp_el_to_eln_filename): On Windowns canonicalize filenames before hashing.
* * Work around bug#46495 (GCC PR99126)Andrea Corallo2021-02-191-0/+15
| | | | | | | * src/comp.c (gcc_jit_context_add_command_line_option): Import for dynamic load. (Fcomp__compile_ctxt_to_file): Disable GCC "isolate-paths" on GCC 10.
* * Remove unnecessary function 'emit_rvalue_from_unsigned_long_long'Andrea Corallo2021-02-191-47/+3
| | | | | | | | * src/comp.c (emit_rvalue_from_unsigned_long_long): Remove function. (emit_rvalue_from_emacs_uint, emit_rvalue_from_lisp_word_tag) (emit_rvalue_from_lisp_word): Make use of 'emit_rvalue_from_long_long'.
* * Pacify GCC warning on non wide-int configurationsAndrea Corallo2021-02-191-8/+12
| | | | | | | * src/comp.c (emit_rvalue_from_emacs_uint) (emit_rvalue_from_lisp_word_tag): Pacify GCC warning. (emit_rvalue_from_unsigned_long_long): Define it only when necessary.
* * Add a bunch of assertions for fixnums coming from Lisp later used as intAndrea Corallo2021-02-181-0/+7
| | | | | | * src/comp.c (emit_limple_insn, declare_lex_function) (compile_function, Fcomp__compile_ctxt_to_file): Add some assertion.
* * Add assertion guarding against emitting a relocation array overflowAndrea Corallo2021-02-181-11/+19
| | | | | | | | | * src/comp.c (reloc_array_t): New type. (comp_t, imm_reloc_t): Make use of 'reloc_array_t'. (obj_to_reloc): Add an assertion not to overflow relocation arrays. (emit_lisp_obj_reloc_lval, emit_limple_insn) (declare_imported_data_relocs): Make use of 'reloc_array_t'.
* * src/comp.c (Fcomp__compile_ctxt_to_file): Clean-up unused variable.Andrea Corallo2021-02-171-2/+0
|
* * Clean-up some signal related dead-codeAndrea Corallo2021-02-161-25/+0
| | | | | * src/comp.c (restore_sigmask): Remove function. (Fcomp__compile_ctxt_to_file): Remove some dead-code.