| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
| |
Pragmas in GCC don't work reliably within function:
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92696>
* src/comp.c (emit_static_object)
(Fcomp_native_driver_options_effective_p)
(Fcomp_libgccjit_version): Move pragmas out of name-scope.
|
|
|
|
|
|
| |
* src/comp.c (Fcomp__register_subr): Fix missing entry into
`load-history' indicating that the loaded function was already an
autoload.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As after each function call GCC clobbers the pointer to the function
relocation table. This commit modify the code generation to create a
local copy of it for each function. This reduces the average number
of loads for each function call into C from two to one.
* src/comp.c (comp_t): Add 'func_relocs_ptr_type' and
'func_relocs_local' fields.
(emit_call): Use the local func_relocs pointer when possible.
(emit_ctxt_code): Fill 'comp.func_relocs_ptr_type'.
(compile_function): Declare 'func_relocs_ptr_local'.
(compile_function): Assign 'func_relocs_ptr_local' from the global
value in each function prologue.
|
|
|
|
|
|
| |
* src/comp.c (declare_imported_func): Make const function pointer
to primitive funcions.
(emit_ctxt_code): Make struct 'comp.func_relocs' const.
|
|
|
|
|
|
|
|
| |
* lisp/emacs-lisp/comp.el (native--compile-async): New defun extracted
from native-compile-async.
(native-compile-async): Remove load argument and use above new defun.
* src/comp.c (maybe_defer_native_compilation): Use above new
defun. (Bug#44676)
|
| |
|
|
|
|
|
| |
* src/comp.c (Fcomp_el_to_eln_filename): Call `file-truename'
in place of `expand-file-name' when available.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lisp/emacs-lisp/comp.el: Remove redundant :group args.
(comp-async-cu-done-hook, comp-async-all-done-hook)
(comp-async-env-modifier-form, comp-dry-run)
(comp-ensure-native-compiler, comp-func-ret-typeset)
(comp-func-ret-range, comp-limple-lock-keywords)
(comp-make-curr-block):
* src/comp.c (Fcomp_el_to_eln_filename, Fcomp__init_ctxt)
(Fcomp_native_driver_options_effective_p)
(Fcomp__compile_ctxt_to_file, Fcomp_libgccjit_version)
(Fcomp__register_lambda, Fcomp__register_subr)
(Fcomp__late_register_subr, Fnative_elisp_load, syms_of_comp): Doc fixes.
|
|
|
|
|
|
| |
* src/comp.c (Fcomp__compile_ctxt_to_file): Now that we do not
rely anymore on globlal variables move logic in from
'Fcomp__init_ctxt' so comp.debug is already set correctly.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit add an initial support for a better type propagation and
integer range propagation.
Each mvar can be now characterized by a set of types, a set of values
and an integral range.
* lisp/emacs-lisp/comp.el (comp-known-ret-types): Store into
typeset and remove fixnum.
(comp-known-ret-ranges, comp-type-predicates): New variables.
(comp-ctxt): Remove supertype-memoize slot and add
union-typesets-mem.
(comp-mvar): Remove const-vld, constant, type slots. Add typeset,
valset, range slots.
(comp-mvar-value-vld-p, comp-mvar-value, comp-mvar-fixnum-p)
(comp-mvar-symbol-p, comp-mvar-cons-p)
(comp-mvar-type-hint-match-p, comp-func-ret-typeset)
(comp-func-ret-range): New functions.
(make-comp-mvar, make-comp-ssa-mvar): Update logic.
(comp--typeof-types): New variable.
(comp-supertypes, comp-common-supertype): Logic update.
(comp-subtype-p, comp-union-typesets, comp-range-1+)
(comp-range-1-, comp-range-<, comp-range-union)
(comp-range-intersection): New functions.
(comp-fwprop-prologue, comp-mvar-propagate)
(comp-function-foldable-p, comp-function-call-maybe-fold)
(comp-fwprop-insn, comp-call-optim-func, comp-finalize-relocs):
Logic update.
* src/comp.c (emit_mvar_rval, emit_call_with_type_hint)
(emit_call2_with_type_hint): Logic update.
* lisp/emacs-lisp/cl-preloaded.el (cl--typeof-types): Undo the add
of fixnum and bignum as unnecessary.
* test/src/comp-tests.el
(comp-tests-mentioned-p-1, comp-tests-cond-rw-checker-val)
(comp-tests-cond-rw-checker-type, cond-rw-1, cond-rw-2)
(cond-rw-3, cond-rw-4, cond-rw-5): Update for new type interface.
(range-simple-union, range-simple-intersection): New integer range
tests.
(union-types): New union type test.
|
|
|
|
|
|
| |
* src/comp.c (ABI_VERSION): Define macro.
(hash_native_abi): Include ABI_VERSION in the hashing.
(syms_of_comp): Tweak docstring.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lisp/emacs-lisp/bytecomp.el (byte-native-qualities): Define
variable.
(byte-compile-from-buffer): Spill compilation qualities.
* lisp/emacs-lisp/comp.el (comp-speed, comp-debug): Make
them file local variables.
(comp-ctxt): Add `speed' and `debug' slots.
(comp-spill-speed, comp-spill-lap-function): Make use of these.
(comp-spill-lap-function): Spill qualities from
`byte-native-qualities'.
(comp-limplify-top-level): Do not use `comp-speed' but ctxt value
unstead.
(comp-final): Do not propagate qualities as they are already
in the `comp-ctxt'.
(comp--native-compile): Close on `byte-native-qualities'.
* src/comp.c (comp_t): Add 'speed' and 'debug' fields.
(emit_comment, emit_mvar_rval, emit_static_object)
(emit_ctxt_code, Fcomp__init_ctxt): Use these instead of the
global variables.
(Fcomp__compile_ctxt_to_file): Set comp.speed and comp.debug and
use them.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a new pass to rewrite conditional branches. This is introducing
and placing a new LIMPLE operator 'assume' in use by fwprop to
propagate conditional branch test informations on target basic blocks.
* lisp/emacs-lisp/comp.el (comp-passes): Add `comp-cond-rw'.
(comp-limple-assignments): Add `assume' operator.
(comp-emit-assume, comp-cond-rw-target-slot, comp-cond-rw-func)
(comp-cond-rw): Add new functions.
(comp-fwprop-insn): Update to pattern match `assume' insns.
* src/comp.c (emit_limple_insn): Add for `assume'.
(syms_of_comp): Define 'Qassume' symbol.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lisp/emacs-lisp/comp.el (comp-trampoline-sym): Remove function.
(comp-trampoline-filename): As we are introducing an ABI change in
the eln trampoline format change the trampoline filename to
disambiguate.
(comp-trampoline-search): Rename from `comp-search-trampoline'
and return directly the trampoline.
(comp-trampoline-compile): Rework to use native form compilation
in place of un-evaluating a function and return directly the
trampoline.
(comp-subr-trampoline-install): Update for
`comp-trampoline-search' and `comp-trampoline-compile' new
interfaces.
* src/comp.c (Fcomp__install_trampoline): Store the trampoline
itself as value in `comp-installed-trampolines-h'.
(syms_of_comp): Doc update `comp-installed-trampolines-h'.
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
| |
* lisp/emacs-lisp/comp.el (comp-ensure-native-compiler): Use
`featurep' to identify if the native compiler is available.
* lisp/emacs-lisp/nadvice.el (advice--add-function): Likewise.
* lisp/emacs-lisp/package.el (package--delete-directory): Likewise.
* lisp/loadup.el: Likewise.
* src/comp.c (syms_of_comp): Provide feature nativecomp.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lisp/emacs-lisp/comp.el (native-compiler-error-dyn-func)
(comp-func, comp-func-l)
(comp-func-d, comp-ensure-native-compiler, comp-type-hint-p)
(comp-func-unique-in-cu-p, comp-alloc-class-to-container)
(comp-limple-mode, comp-loop-insn-in-block)
(comp-lex-byte-func-p, comp-c-func-name, comp-decrypt-arg-list)
(comp-spill-lap-function, comp-intern-func-in-ctxt)
(comp-spill-lap-function, comp-spill-lap, comp-emit-handler)
(comp-prepare-args-for-top-level): Various typo fixes.
* src/comp.c (Fcomp_el_to_eln_filename): Fix typo in error
message.
|
|
|
|
|
|
|
|
| |
* src/comp.c (make_directory_wrapper, make_directory_wrapper_1):
New functions.
(Fcomp_el_to_eln_filename): If base_dir is not
specified and we are searching across `comp-load-path' try to
create a directory if does not exists.
|
|
|
|
|
|
| |
* src/comp.c (Fcomp_el_to_eln_filename): Check for write
permission while choosing the output directory in
`comp-eln-load-path'.
|
|
|
|
|
|
|
|
|
|
| |
* lisp/loadup.el (dump-mode): Set `comp-enable-subr-trampolines'
when finished bootstrap.
* src/data.c (Ffset): Call `comp-enable-subr-trampolines' when
redefining a subr.
* src/comp.c (syms_of_comp): Define `comp-subr-trampoline-install'
symbol.
(syms_of_comp): Define `comp-enable-subr-trampolines' variable.
|
|
|
|
|
|
|
|
|
|
| |
* Makefile.in (lispdirrel): Add replace template.
(epaths-force): Form correctly 'PATH_REL_LOADSEARCH' into epath.h
* configure.ac (lispdirrel): Define variable (relative path of the
lisp files from the installation directory).
* src/comp.c (Fcomp_el_to_eln_filename): Update algorithm not to
rely on 'PATH_DUMPLOADSEARCH' but on 'PATH_REL_LOADSEARCH'.
* src/epaths.in (PATH_REL_LOADSEARCH): Add macro template.
|
|
|
|
|
|
|
| |
* src/comp.c (Fcomp_el_to_eln_filename)
(Fcomp__compile_ctxt_to_file): Improve docstring.
(Fcomp__compile_ctxt_to_file): Rename 'file_name' -> 'filename'.
(Fnative_comp_available_p): Improve docstring.
|
|
|
|
|
|
| |
* lisp/emacs-lisp/comp.el: Rename non nil -> non-nil in doc.
* src/comp.c: Likewise.
|
|
|
|
|
|
|
|
|
| |
* src/comp.c (syms_of_comp): Define and initialize
'Vcomp_installed_trampolines_h'.
(Fcomp__install_trampoline): Fill 'Vcomp_installed_trampolines_h'
* lisp/emacs-lisp/comp.el (comp--subr-safe-advice): Make use of
`comp-installed-trampolines-h' to guard against installing a
trampoline twice.
|
|
|
|
|
|
|
|
| |
* src/comp.c (Fcomp__install_trampoline): New function to
install a subr trampoline into the function relocation table.
Once this is done any call from native compiled Lisp to the
related primitive will go through the `funcall' trampoline
making advicing effective.
|
|
|
|
|
|
| |
* src/comp.c (Fcomp_el_to_eln_filename): Adapt the filename
hashing algorithm to allow for producing a MacOS self-contained
Emacs.app.
|
|
|
|
|
|
|
|
|
| |
Tipically errors are catched in 'compile_function' but in case
libgccjit throw an error only afterwards while compiling the whole
compilation unit we have to report it correctly.
* src/comp.c (Fcomp__compile_ctxt_to_file): Catch libgccjit
errors after calling 'gcc_jit_context_compile_to_file'.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use this brand new entry point to avoid the current workaround and its
load-time memcpys.
* src/comp.c (gcc_jit_global_set_initializer): Add to the dynamic
load machinery.
(static_obj_t): Remove const qualifier from the data field.
(emit_static_object): Make use of 'gcc_jit_global_set_initializer'
when available.
(load_static_obj): Use the blob for loading if that was emitted.
|
|
|
|
|
| |
* src/comp.c (file_in_eln_sys_dir): New function.
(Fnative_elisp_load): Make use of.
|
|
|
|
|
| |
* src/comp.c (Fnative_elisp_load): Don't rename files we don't
have the permission for.
|
|
|
|
|
|
| |
bootstrap."
This reverts commit 15acd27d1c0de8b56bab61daa0a8fcd4fef0fdc4.
|
| |
|
|
|
|
|
| |
* src/comp.c (Fcomp__compile_ctxt_to_file): Postfix temporary eln
files as .eln.tmp.
|
| |
|
|
|
|
|
|
| |
When loading a file if in this session there was ever a file loaded
with that name rename it before loading it to make sure we always get
a new handle from the standard library.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rename eln sys directory into 'native-lisp' and move it from
"$(DESTDIR)${libexecdir}/emacs/${version}/${configuration}/" to
"$(DESTDIR)${libdir}/emacs/".
Add to the directory name used to disambiguate the eln compatibility
the Emacs version to have it more user friendly.
* Makefile.in (clean, install-eln): Rename eln-cache into
native-lisp.
(ELN_DESTDIR): Move from
'$(DESTDIR)${libexecdir}/emacs/${version}/${configuration}/' to
'$(DESTDIR)${libdir}/emacs/'.
* lisp/loadup.el: Update for comp-native-path-postfix ->
comp-native-version-dir rename.
* src/comp.c (syms_of_comp): Rename eln-cache -> native-lisp.
(syms_of_comp, Fcomp_el_to_eln_filename): Rename
comp-native-path-postfix -> comp-native-version-dir.
(hash_native_abi): Rework and add emacs-version to
comp-native-version-dir.
|
|\ |
|
| |
| |
| |
| |
| | |
* src/comp.c (init_gccjit_functions): Use LOAD_DLL_FN_OPT to init
'gcc_jit_context_add_driver_option' as this is optional.
|
| |
| |
| |
| |
| |
| |
| |
| | |
* src/comp.c (Fcomp_native_driver_options_effective_p)
Rename plus better doc.
(add_driver_options, syms_of_comp): Rename
`comp-native-driver-options-available-p' into
comp-native-driver-options-effective-p.
|
| | |
|
| |
| |
| |
| |
| | |
* src/comp.c (comp-native-driver-options-available-p): New
function that returns t if driver options can be used.
|
| |
| |
| |
| |
| | |
* src/comp.c (add_driver_options): Use
load_gccjit_if_necessary and FOR_EACH_TAIL + GNU style.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Instead of conditionalizing on the wrong preprocessor flag, now use
the right one: LIBGCCJIT_HAVE_gcc_jit_context_add_driver_option
* Also perform the driver-option-adding step on win NT, but only if
the function is non-NULL.
* Make the function declaration for add_driver_options non-old-style.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add a customizable variable for driver options (such as linker flags)
to pass to libgccjit (Bug #42761).
* lisp/emacs-lisp/comp.el (comp-native-driver-options): New
customization variable.
* src/comp.c: Use comp-native-driver-options to set libgccjit's driver
options, if supported on the library's ABI version.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Generate eln filename hashing also the source file content in the form:
/absolute/path/filename.el + content ->
eln-cache/filename-path_hash-content_hash.eln
* src/lread.c (maybe_swap_for_eln): Always call
Fcomp_el_to_eln_filename on an existing source file.
* src/comp.c (md5.h, sysstdio.h, zlib.h): New include.
(comp_hash_string): Use md5 instead of sha512.
(MD5_BLOCKSIZE): New macro.
(accumulate_and_process_md5, final_process_md5, md5_gz_stream)
(comp_hash_source_file): New functions.
(Fcomp_el_to_eln_filename): Rework for hasing using also source
file content.
* src/lread.c (maybe_swap_for_eln): Rename el_name -> src_name as
this can be also a have .el.gz extention.
|
|/
|
|
|
|
| |
This reverts commit 8a931a97b8dd19a38d6f719f810280a07ba76438.
This introduced bug#42944.
|
|
|
|
|
|
|
|
|
|
|
|
| |
'dlopen' can return the same handle if two shared with the same
filename are loaded in two different times (even if the first was
deleted!). To prevent this scenario the last modification time of the
source file is included in the hashing algorithm.
* src/comp.c (Fcomp_el_to_eln_filename): Update hashing algo to
include the source last modification date.
* src/lread.c (maybe_swap_for_eln): Do not check for eln newer
then elc as this is now unnecessary.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make eln filename hashing logic insensitive to the installation
process.
* src/comp.c (epaths.h): New include to have PATH_DUMPLOADSEARCH,
PATH_LOADSEARCH definitions.
(loadsearch_re_list): New static var.
(Fcomp_el_to_eln_filename): Update logic to have the eln hashing
insensitive to the installation process.
(syms_of_comp): GC protect 'loadsearch_re_list'.
|