1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-13 09:32:47 +00:00
Commit Graph

628 Commits

Author SHA1 Message Date
Stefan Kangas
d55d5358b2 ; * lisp/emacs-lisp/comp.el: Fix typos. Add LocalWords. 2021-04-27 14:17:44 +02:00
Glenn Morris
40a1e94f4c Doc fixes for comp.el
* lisp/emacs-lisp/comp.el (comp-deferred-compilation-deny-list)
(comp-bootstrap-deny-list, comp-pred-to-cstr, make-comp-mvar)
(comp-mvar-used-p, comp-async-compilation): Doc fixes.
2021-04-26 22:18:14 -07:00
Glenn Morris
b3b2cba5ca Fix some custom types in comp.el
* lisp/emacs-lisp/comp.el (comp-deferred-compilation-deny-list)
(comp-bootstrap-deny-list, comp-never-optimize-functions)
(comp-async-env-modifier-form, comp-native-driver-options):
Fix :type (`list' on its own isn't even a valid type).
2021-04-26 22:09:46 -07:00
Stefan Kangas
e1541b5cb4 Rename abnormal hook to comp-async-cu-done-functions
* lisp/emacs-lisp/comp.el (comp-async-cu-done-functions): Rename
from 'comp-async-cu-done-hook' to reflect that it is an abnormal
hook.  Doc fix and update single caller.
2021-04-27 03:37:43 +02:00
Andrea Corallo
edf42af2cc Rework where `comp-ctxt' is defined.
* test/lisp/emacs-lisp/comp-cstr-tests.el (comp-ctxt): Remove
	`comp-ctxt' definition.
	* lisp/emacs-lisp/comp.el (comp-ctxt): Likewise.
	* lisp/emacs-lisp/comp-cstr.el (comp-ctxt): Define it here.
2021-04-26 23:01:39 +02:00
Andrea Corallo
4396ef5a38 * lisp/emacs-lisp/comp.el: Make it loadable in vanilla builds (bug#48021). 2021-04-26 22:45:08 +02:00
Andrea Corallo
fbfb503012 * lisp/emacs-lisp/comp.el (comp-known-type-specifiers): Fix string-search. 2021-04-26 22:32:05 +02:00
Andrea Corallo
58fc16063c * lisp/emacs-lisp/comp.el (comp-accept-and-process-async-output): Fix regexp. 2021-04-26 16:00:03 +02:00
Glenn Morris
b7c22fab7d ; Add 2021 to copyright years 2021-04-25 17:24:48 -07:00
Stefan Kangas
ec2ccae3e6 * lisp/emacs-lisp/comp.el (no-native-compile): Minor doc fixes. 2021-04-25 20:47:44 +02:00
Andrea Corallo
606188a360 * lisp/emacs-lisp/comp.el (comp-imm-equal-test): Style fix. 2021-04-21 23:15:56 +02:00
Andrea Corallo
de16621b51 * lisp/emacs-lisp/comp.el (batch-byte-native-compile-for-bootstrap): Fix typo. 2021-04-21 17:36:59 +02:00
Andrea Corallo
f842816125 Fix native compiler string hash consing strategy (bug#47868)
* test/src/comp-tests.el (comp-test-47868-1): Add new test.
	* test/src/comp-test-funcs.el (comp-test-47868-1-f)
	(comp-test-47868-2-f): New functions.
	* lisp/emacs-lisp/comp.el (comp-imm-equal-test): Define new hash
	tanble test.
	(comp-data-container): Use it.
	(comp-final, comp-run-async-workers): have comp required before
	reading dumped hashes so that `comp-imm-equal-test' is defined.
2021-04-21 17:36:59 +02:00
Ashish SHUKLA
f9c1008ced * lisp/emacs-lisp/comp.el (comp-effective-async-max-jobs): Handle BSD. 2021-04-16 11:13:09 +02:00
Andrea Corallo
1f8d75160a * Improve some docstring in comp.el
* lisp/emacs-lisp/comp.el (comp--native-compile)
	(batch-native-compile, batch-byte-native-compile-for-bootstrap):
	Improve docstring.
2021-04-07 17:33:35 +02:00
Andrea Corallo
1ad0ecea2b * lisp/emacs-lisp/comp.el (comp-clean-up-stale-eln): Clean-up all .eln dirs. 2021-04-04 22:51:24 +02:00
Andrea Corallo
dc393517ca Issue a warning when eln look-up fails due to missing .el source file.
* 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'.
2021-04-01 21:49:38 +02:00
Andrea Corallo
8e524f4591 * lisp/emacs-lisp/comp.el (comp-final): Clean-up temporary file. 2021-03-31 20:38:32 +02:00
Andrea Corallo
53ca0d9844 Rework native compilation `comp-debug' (bug#46495)
* 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.
2021-03-31 20:25:08 +02:00
Andrea Corallo
aa159bf696 * lisp/emacs-lisp/comp.el (comp-debug): Fix docstring. 2021-03-31 10:24:55 +02:00
Andrea Corallo
92914ade6d Improve two native compiler related docstrings.
* lisp/emacs-lisp/comp.el (comp-eln-load-path-eff): Improve docstring.
	* src/comp.c (comp-eln-load-path): Likewise.
2021-03-24 17:02:40 +01:00
Andrea Corallo
7ba816ee1c * lisp/emacs-lisp/comp.el (comp-lookup-eln): Add autoload cookie. 2021-03-21 21:55:13 +01:00
Andrea Corallo
6351953dcd * lisp/emacs-lisp/comp.el (comp-lookup-eln): Add new function. 2021-03-21 21:50:22 +01:00
Andrea Corallo
d0280ce1b1 Revert "* lisp/emacs-lisp/comp.el (comp-clean-up-stale-eln): Clean-up all..."
This reverts commit be22cda7be.

Older binaries might still need those .eln if they where preloaded.
2021-03-21 15:34:38 +01:00
Andrea Corallo
08682ccc31 ; Remove two unnecessary quotes
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-=): Remove unnecessary
	quote.
	* lisp/emacs-lisp/comp.el (comp-compile-ctxt-to-file): Likewise.
2021-03-21 09:28:25 +01:00
Andrea Corallo
be22cda7be * lisp/emacs-lisp/comp.el (comp-clean-up-stale-eln): Clean-up all .eln dirs. 2021-03-21 09:15:25 +01:00
Andrea Corallo
3e133cc050 Fix `no-byte-compile' native compilation interaction (bug#47169)
* lisp/emacs-lisp/comp.el (comp-spill-lap-function): Throw
	no-native-compile when `byte-native-qualities' are null.
	* lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): No need
	to consider `no-byte-compile'.
2021-03-16 19:02:57 +01:00
Andrea Corallo
f3abb17118 Have no-byte-compile' implies also no-native-compile'.
* lisp/emacs-lisp/comp.el (no-native-compile): Update doctring.
	* lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): when
	`no-byte-compile' is set to non-nil it overrides this.
2021-03-16 09:12:46 +01:00
Eli Zaretskii
aabda4263b Prefer expand-file-name to concat in native-compilation code
* 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)
2021-03-15 16:56:08 +02:00
Andrea Corallo
5e4ec4d3c9 Fix some entry in `comp-known-type-specifiers' (bug#46847)
* lisp/emacs-lisp/comp.el (comp-known-type-specifiers): Some
	fix.
	* test/src/comp-tests.el (comp-tests-46670-1): Update test.
2021-03-14 22:05:02 +01:00
Andrea Corallo
d018584814 * Fix circular dependecy when loading a modified comp.el (bug#47049)
* lisp/emacs-lisp/comp.el (comp-subr-trampoline-install): Move it
	before other functional code.
2021-03-12 22:35:23 +01:00
Andrea Corallo
d9cd55a4f1 Implement `no-native-compile' (bug#46983)
* lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Capture
	`no-native-compile'.
	* lisp/emacs-lisp/comp.el (no-native-compile): Define new
	variable.
	(comp-spill-lap-function): Throw when `no-native-compile' was
	captured non-nil.
	(comp--native-compile): Catch `no-native-compile' if necessary and
	return nil in case.
2021-03-12 13:11:45 +01:00
Andrea Corallo
0144764d1d * Fix error reporting for async native compilation (bug#47024)
* lisp/emacs-lisp/comp.el (comp--native-compile): During async
	compilation if we catch an error print it in a parsable way so we
	can report it to the user.
2021-03-12 10:03:09 +01:00
Andrea Corallo
fe1c081c38 * Fix truncated warnings (bug#47024)
* lisp/emacs-lisp/comp.el (comp-run-async-workers): Bind
	`warning-fill-column' to `most-positive-fixnum'.
2021-03-10 15:50:58 +01:00
Andrea Corallo
9809f7ed2c Use `length=' and family where possible in native comp code
* lisp/emacs-lisp/comp-cstr.el (comp-intersect-typesets)
	(comp-cstr-imm): Use Use `length=' and family where possible.
	* lisp/emacs-lisp/comp.el (comp-add-cond-cstrs-target-block)
	(comp-compute-dominator-frontiers)
	(batch-byte-native-compile-for-bootstrap): Likewise.
2021-03-07 21:33:53 +01:00
Andrea Corallo
b6f06c32b4 * lisp/emacs-lisp/comp.el (w32-get-nproc): Suppress warning declaring it.
For non Windows system.
2021-03-07 20:26:46 +01:00
Andrea Corallo
dbdc44db15 Allow for `comp-native-driver-options' to work as a file-local variable. 2021-03-07 20:19:20 +01:00
Eli Zaretskii
619f66f423 Use MS-Windows system APIs to get number of processors
* lisp/emacs-lisp/comp.el: Use 'w32-get-nproc' instead of the
environment variable NUMBER_OF_PROCESSORS.

* src/w32proc.c (Fw32_get_nproc): New primitive.
* src/w32.c (w32_get_nproc): New function.
(sample_system_load): Call w32_get_nproc to initialize the number
of processors on this system.
* src/w32.h (w32_get_nproc): Add prototype.
2021-03-07 15:32:55 +02:00
Pip Cet
6c73418c95 Fix miscompilation of funcall forms in some cases (bug#46974)
* lisp/emacs-lisp/comp.el (comp-call-optim-func): Call
comp-cstr-imm-vld-p before relying on comp-cstr-imm to return the
right value.
2021-03-06 20:53:57 +00:00
Andrea Corallo
3848f3bff0 * lisp/emacs-lisp/comp.el (comp-add-cond-cstrs-simple): Suppress warning. 2021-03-06 20:52:34 +01:00
Eli Zaretskii
b456b19ec4 Fix typos and doc strings in native-compilation files
* lisp/emacs-lisp/comp.el (comp-speed, comp-debug, comp-verbose)
(comp-always-compile, comp-deferred-compilation-deny-list)
(comp-bootstrap-deny-list, comp-never-optimize-functions)
(comp-async-jobs-number, comp-async-cu-done-hook)
(comp-async-all-done-hook, comp-async-env-modifier-form)
(comp-pass, comp-native-compiling, comp-post-pass-hooks)
(comp-known-predicate-p, comp-pred-to-cstr)
(comp-symbol-values-optimizable, comp-limple-assignments)
(comp-limple-calls, comp-limple-branches, comp-block)
(comp-vec--verify-idx, comp-vec-aref, comp-vec-append)
(comp-vec-prepend, comp-block-preds)
(comp-ensure-native-compiler, comp-log, comp-log-func)
(comp-loop-insn-in-block, comp-byte-frame-size)
(comp-add-func-to-ctxt, comp-spill-lap-function, comp-spill-lap)
(comp-lap-fall-through-p, comp-new-frame, comp-emit-set-call)
(comp-copy-slot, comp-latch-make-fill, comp-emit-cond-jump)
(comp-body-eff, comp-op-case, comp-prepare-args-for-top-level)
(comp-limplify-top-level, comp-negate-arithm-cmp-fun)
(comp-emit-assume, comp-cond-cstrs-target-mvar)
(comp-function-foldable-p, comp-function-call-maybe-fold)
(comp-form-tco-call-seq, comp-clean-up-stale-eln)
(comp-delete-or-replace-file, comp--native-compile)
(native--compile-async, native-compile)
(batch-byte-native-compile-for-bootstrap): Fix typos, wording, and
punctuation in doc strings.
* lisp/loadup.el: Fix typos.

* src/lread.c (syms_of_lread): Doc fix.
2021-03-04 20:36:43 +02:00
Andrea Corallo
3d014e1bf4 Fix eql' equal' propagation of non hash consed values (bug#46843)
Extend assumes allowing the following form:

(assume dst (and-nhc src1 src2))

`and-nhc' assume operator allow for constraining correctly
intersections where non hash consed values are not propagated as
values but rather promoted to their types.

	* lisp/emacs-lisp/comp-cstr.el
	(comp-cstr-intersection-no-hashcons): New function.
	* lisp/emacs-lisp/comp.el (comp-emit-assume): Logic update to emit
	`and-nhc' operator (implemented in fwprop by
	`comp-cstr-intersection-no-hashcons').
	(comp-add-cond-cstrs): Map `eq' to `and' assume operator and
	`equal' `eql' into `and-nhc'.
	(comp-fwprop-insn): Update to handle `and-nhc'.
	* test/src/comp-tests.el (comp-tests-type-spec-tests): Add two
	tests covering `eql' and `equal' propagation of non hash consed
	values.
2021-03-01 18:09:40 +01:00
Andrea Corallo
5bc08559e8 Don't treat '=' as simple equality emitting constraints (bug#46812)
Extend assumes allowing the following form

(assume dst (= src1 src2))

to caputure '=' semanting during fwprop handling float integer
conversions.

	* lisp/emacs-lisp/comp.el (comp-equality-fun-p): Don't treat '=' as
	simple equality.
	(comp-arithm-cmp-fun-p, comp-negate-arithm-cmp-fun)
	(comp-reverse-arithm-fun): Rename and add '=' '!='.
	(comp-emit-assume, comp-add-cond-cstrs, comp-fwprop-insn): Update
	for new function nameing and to handle '='.
	* lisp/emacs-lisp/comp-cstr.el (comp-cstr-=): New function.
	* test/src/comp-tests.el (comp-tests-type-spec-tests): Add a bunch
	of '=' specific tests.
2021-02-28 23:30:03 +01:00
Andrea Corallo
2acc46b55b Migrate and rename a bunch of functions from comp.el to comp-cstr.el
* 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.
2021-02-28 23:29:49 +01:00
Stefan Kangas
cedc55041e Make some defcustom types stricter in comp.el
* lisp/emacs-lisp/comp.el (comp-speed, comp-debug, comp-verbose)
(comp-async-jobs-number, comp-async-env-modifier-form): Use stricter
types.
2021-02-26 18:11:29 +01:00
Stefan Kangas
720bd747a8 Add :version tags to defcustoms in comp.el
* lisp/emacs-lisp/comp.el (comp-speed, comp-debug, comp-verbose)
(comp-never-optimize-functions, comp-async-jobs-number)
(comp-async-cu-done-hook, comp-async-all-done-hook)
(comp-async-env-modifier-form)
(comp-async-report-warnings-errors, comp-native-driver-options)
(comp-libgccjit-reproducer): Add :version tags.
2021-02-26 18:01:02 +01:00
Eli Zaretskii
5540d73441 Fix last change
* lisp/emacs-lisp/comp.el (comp-async-report-warnings-errors):
Improve wording of the doc string.
2021-02-26 16:50:41 +02:00
Andrea Corallo
ad74b1b2b6 * Improve `comp-async-report-warnings-errors' docstring
* lisp/emacs-lisp/comp.el (comp-async-report-warnings-errors):
	Improve docstring.
2021-02-26 15:24:34 +01:00
Eli Zaretskii
3266093af9 Improve documentation of last change
* lisp/emacs-lisp/comp.el (comp-async-query-on-exit)
(comp-async-report-warnings-errors): Improve wording.
2021-02-26 16:08:44 +02:00
Andrea Corallo
54df918ad1 * Add `comp-async-query-on-exit' customize.
* lisp/emacs-lisp/comp.el (comp-async-query-on-exit): New customize.
	(comp-run-async-workers): Make use of.
2021-02-26 14:33:08 +01:00