| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
|
| |
* src/comp.h, src/thread.h: Add INLINE_HEADER_BEGIN and
INLINE_HEADER_END, since it uses INLINE.
* src/emacs.c: Include these two files.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The C standard does not allow size-zero arrays, so redo struct
Lisp_Subr to not use size-zero arrays when native compilation is
not being used. Formerly, the code was using size-zero arrays (a
GNU C extension) to avoid using memory unnecessarily when
HAVE_NATIVE_COMP is not defined. Replace this hack with the
more-traditional hack of putting the relevant members inside
‘#ifdef HAVE_NATIVE_COMP’.
* src/alloc.c (cleanup_vector, mark_object):
* src/comp.c (make_subr):
* src/data.c (Fsubr_native_lambda_list, Fsubr_native_comp_unit):
* src/eval.c (init_eval_once, funcall_lambda):
* src/lisp.h (SUBR_NATIVE_COMPILEDP, SUBR_NATIVE_COMPILED_DYNP)
(SUBR_TYPE):
* src/lread.c (Fload):
Conditionally compile with ‘#ifdef HAVE_NATIVE_COMP’ instead of
with ‘if (NATIVE_COMP_FLAG)’. Redo members like native_comp_u[0]
to be plain native_comp_u. Put all uses of these members inside
‘#ifdef HAVE_NATIVE_COMP’.
* src/lisp.h (struct Lisp_Subr): Members native_comp_u,
native_c_name, lambda_list, type are now all ifdeffed out if
HAVE_NATIVE_COMP is not defined, instead of being size-zero
arrays. All uses changed.
* src/pdumper.c (dump_subr, dump_cold_native_subr)
(dump_do_dump_relocation):
* src/comp.h (NATIVE_COMP_FLAG): Remove; no longer needed.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
| |
|
|
|
|
|
| |
* src/alloc.c (cleanup_vector): Call unload_comp_unit.
* src/comp.c (unload_comp_unit): New function.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* lisp/emacs-lisp/comp.el (comp-emit-for-top-level): Synthesize
'top_level_run' so it returns the last value returned by
`comp--register-subr'.
* src/comp.c (load_comp_unit): Return what 'top_level_run'
returns.
(Fnative_elisp_load): Return what 'load_comp_unit' returns.
* src/comp.h (load_comp_unit): Update signature.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When recompiling remove the corresponding stale elns found in the
`comp-eln-load-path'.
When removing a package remove the corresponding elns too.
On Windows both of these are performed only when possible, when it's
not the file is renamed as .eln.old and a last attempt to remove this
is performed closing the Emacs session. When a file being deleted was
loaded by multiple Emacs sessions the last one being closed should
delete it.
* lisp/emacs-lisp/comp.el (comp-clean-up-stale-eln): New function.
(comp-delete-or-replace-file): Rename from
`comp--replace-output-file' and update so it can be used for
replacing or deleting shared libs safetly.
* lisp/emacs-lisp/package.el (package--delete-directory): When
native compiled just call `comp-clean-up-stale-eln' for each
eln file we want to clean-up.
* src/alloc.c (cleanup_vector): Call directly the dynlib_close.
* src/comp.c (syms_of_comp): Update for comp_u->cfile removal.
Make 'all_loaded_comp_units_h' key-value weak as now the key will
be the filename.
(load_comp_unit): Register the compilation unit only when the load
is fully completed.
(register_native_comp_unit): Make the key of
all_loaded_comp_units_h the load filename.
(eln_load_path_final_clean_up): New function.
(dispose_comp_unit)
(finish_delayed_disposal_of_comp_units)
(dispose_all_remaining_comp_units)
(clean_package_user_dir_of_old_comp_units): Remove.
(Fcomp__compile_ctxt_to_file): Update for
`comp--replace-output-file' -> `comp-delete-or-replace-file'
rename.
* src/comp.h (dispose_comp_unit)
(finish_delayed_disposal_of_comp_units)
(dispose_all_remaining_comp_units)
(clean_package_user_dir_of_old_comp_units): Remove.
(eln_load_path_final_clean_up): Add.
(struct Lisp_Native_Comp_Unit): Remove cfile field.
* src/emacs.c (Fkill_emacs): Call 'eln_load_path_final_clean_up'.
* src/pdumper.c (dump_do_dump_relocation): Do not set comp_u->cfile.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/comp.h (fixup_eln_load_path): New extern.
* src/comp.c (fixup_eln_load_path): New function.
* src/pdumper.c (dump_do_dump_relocation): Update to make use of
'fixup_eln_load_path'.
* lisp/loadup.el: Update to store in the compilation unit the
correct eln-cache installed path. Rename --lisp-dest -> --eln-dest
and.
* Makefile.in: Pass the eln destination directory to
src/Makefile. Rename LISP_DESTDIR -> ELN_DESTDIR.
(ELN_DESTDIR): Define.
(install-eln): New target.
(install): Add install-eln as prerequisite.
* src/Makefile.in: Rename --lisp-dest -> --eln-dest and
LISP_DESTDIR -> ELN_DESTDIR.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Removing `Vcomp_sym_subr_c_name_h' all c_name functions are GC
markable only through 'data_ephemeral_vec'. A recursive load must not
overide its content otherwise a previously activated load will have
the original content collected before it's used.
* src/comp.h (struct Lisp_Native_Comp_Unit): Add 'load_ongoing'
field.
* src/comp.c (unset_cu_load_ongoing): New function.
(load_comp_unit): Update logic to detect and handle recursive
loads.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* src/comp.h (struct Lisp_Native_Comp_Unit): Rename
lambda_gc_guard -> lambda_gc_guard_h
* src/pdumper.c (dump_do_dump_relocation): Likewise.
* src/comp.c (check_comp_unit_relocs, Fcomp__register_lambda)
(Fnative_elisp_load): Likewise.
|
|
|
|
|
|
|
| |
* src/comp.c (syms_of_comp): Add a comment to ease #endif
understading.
* src/comp.h: Likewise.
|
|
|
|
|
|
|
|
|
|
| |
* src/comp.h: Fix GNU style.
* src/comp.c (Fcomp__compile_ctxt_to_file): Likewise.
* lisp/emacs-lisp/comp.el (comp--replace-output-file): Likewise.
* src/pdumper.c (dump_do_dump_relocation): Likewise.
|
|
|
|
|
|
|
|
|
|
|
| |
* src/emacs.c (Fkill_emacs): Given
'finish_delayed_disposal_of_comp_units',
'dispose_all_remaining_comp_units' and
'clean_package_user_dir_of_old_comp_units' are defined only with
windows native-comp builds ifdef them.
* src/comp.h (dispose_comp_unit): Fix missing parameter in
declaration.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When closing emacs will inspect all directories from which it loaded
native compilation units. If it finds a ".eln.old" file it will try to
delete it, if it fails that means that another Emacs instance is using it.
When compiling a file we rename the file that was in the output path
in case it has been loaded into another Emacs instance.
When deleting a package we move any ".eln" or ".eln.old" files in the
package folder that we can't delete to `package-user-dir`. Emacs will
check that directory when closing and delete them.
* lisp/emacs-lisp/comp.el (comp--replace-output-file): Function called
from C code to finish the compilation process. It performs renaming of
the old file if necessary.
* lisp/emacs-lisp/package.el (package--delete-directory): Function to
delete a package directory. It moves native compilation units that it
can't delete to `package-user-dir'.
* src/alloc.c (cleanup_vector): Call dispose_comp_unit().
(garbage_collect): Call finish_delayed_disposal_of_comp_units().
* src/comp.c: Restore the signal mask using unwind-protect. Store
loaded native compilation units in a hash table for disposal on
close. Store filenames of native compilation units GC'd in a linked
list to finish their disposal when the GC is over.
(clean_comp_unit_directory): Delete all *.eln.old files in a
directory.
(clean_package_user_dir_of_old_comp_units): Delete all *.eln.old files
in `package-user-dir'.
(dispose_all_remaining_comp_units): Dispose of native compilation
units that are still loaded.
(dispose_comp_unit): Close handle and cleanup directory or arrange for
later cleanup if DELAY is true.
(finish_delayed_disposal_of_comp_units): Dispose of native compilation
units that were GC'd.
(register_native_comp_unit): Register native compilation unit for
disposal when Emacs closes.
* src/comp.h: Introduce cfile member in Lisp_Native_Comp_Unit.
Add declarations of functions that: clean directories of unused native
compilation units, handle disposal of native compilation units.
* src/emacs.c (kill-emacs): Dispose all remaining compilation units
right right before calling exit().
* src/eval.c (internal_condition_case_3, internal_condition_case_4):
Add functions.
* src/lisp.h (internal_condition_case_3, internal_condition_case_4):
Add functions.
* src/pdumper.c (dump_do_dump_relocation): Set cfile to a copy of the
Lisp string specifying the file path.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* configure.ac: don't add linker flags if compiling on
Windows. Compile dynlib.c if modules or native compilation are
enabled. Always compile comp.c
* lisp/term/w32-win.el: Map 'gccjit to "libgccjit.dll" in
`dynamic-library-alist`.
* src/Makefile.in: Update comments. Update to handle changes in
configure.ac.
* src/comp.c: Add declarations of used libgccjit functions using
DEF_DLL_FN. Add calls to load_gccjit_if_necessary() where necessary.
Add `native-comp-available-p`
* src/comp.h: Remove Fnative_elisp_load. Add syms_of_comp().
* src/emacs.c (main): Always call syms_of_comp()
* src/w32.c (globals_of_w32): Clear Vlibrary_cache when starting
because the libraries loaded when dumping will not be loaded when
starting.
* src/w32fns.c: Add Qgccjit symbol.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/pdumper.c (dump_do_dump_relocation): Initialize
'lambda_gc_guard' while resurrecting.
(dump_do_dump_relocation): Revive lambdas and fixup them.
* src/comp.h (struct Lisp_Native_Comp_Unit): Define new
'lambda_gc_guard' 'lambda_c_name_idx_h' 'data_imp_relocs'
'loaded_once' fields.
* src/comp.c (load_comp_unit): Use compilaiton unit 'loaded_once'
field.
(make_subr, Fcomp__register_lambda): New functions.
(Fcomp__register_subr): Make use of 'make_subr'.
(Fnative_elisp_load): Indent.
(Fnative_elisp_load): Initialize 'lambda_gc_guard'
'lambda_c_name_idx_h' fields.
(syms_of_comp): Add Scomp__register_lambda.
* lisp/emacs-lisp/comp.el (comp-ctxt): Change
'byte-func-to-func-h' hash key test.
(comp-ctxt): Add 'lambda-fixups-h' slot.
(comp-emit-lambda-for-top-level): New function.
(comp-finalize-relocs): Never emit lambdas in pure space.
(comp-finalize-relocs): Fixup relocation indexes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lisp/emacs-lisp/comp.el (comp-finalize-relocs): Convert doc hash
table into vector befor final.
(comp-emit-for-top-level): Rename `comp-ctxt-doc-index-h' ->
`comp-ctxt-function-docs'.
(comp-ctxt): Likewise.
* src/comp.c (native_function_doc): Update logic for documentation
being a vector.
(emit_ctxt_code): Update for 'comp-ctxt-doc-index-h' slot rename.
* src/comp.h (struct Lisp_Native_Comp_Unit): Rename 'data_fdoc_h'
into data_fdoc_v.
* src/pdumper.c (dump_native_comp_unit): Likewise.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/comp.c (native_function_doc): New function.
(load_comp_unit): Do not load function doc during load.
* src/comp.h: Extern 'native_function_doc'.
* src/doc.c (Fdocumentation): Call 'native_function_doc' to
retrive function doc.
* src/pdumper.c (dump_native_comp_unit): Zero 'data_fdoc_h' before
dumping.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/pdumper.c (dump_subr): Update Lisp_Subr hash.
(dump_subr): Update for new compilation unit layout.
(dump_vectorlike): Update pvec_type hash.
* src/lisp.h (struct Lisp_Subr): Remove 'native_doc' index.
(DEFUN): Update macro for new compilation unit
layout.
* src/doc.c (Fdocumentation): Update for new compilation unit
layout.
* src/comp.h (struct Lisp_Native_Comp_Unit):
Add 'data_fdoc_h' field.
* src/comp.c (TEXT_FDOC_SYM): New macro.
(emit_ctxt_code): Emit function documentations.
(load_comp_unit): Load function documentation.
(Fcomp__register_subr): Rename parameter.
(Fcomp__register_subr): Update for new compilation unit
layout.
* src/alloc.c (mark_object): Update for new compilation unit
layout.
(syms_of_alloc): Likewise.
* lisp/emacs-lisp/comp.el (comp-ctxt): Add doc-index-h slot.
(comp-emit-for-top-level): Emit doc index as 'comp--register-subr'
doc parameter.
|
| |
|
|
|
|
|
| |
Introduce a first mechanism to trigger compilation when lex elc files
are loaded. This is off by default and has to be better tested.
|
| |
|
|
|
|
| |
For now just comp-speed and comp-debug are stored.
|
| |
|
|
|
|
| |
Rework the functionality of the previous commit to be more efficient.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|