emacs/lisp/emacs-lisp
Alan Mackenzie 1cd188799f Make symbols with positions work with native compilation
This version of the software should bootstrap Emacs successfully with native
compilation enabled.

* lisp/emacs-lisp/bytecomp.el (byte-compile-strip-s-p-1)
(byte-compile-strip-symbol-positions): Rename and move to macroexp.el.  Rename
calls to these functions throughout the file.
(byte-compile-initial-macro-environment): In the code sections for
eval-when-compile and eval-and-compile, call macroexp-strip-symbol-positions
before evaluating code.
(byte-compile-file, byte-compile-output-file-form)
(byte-compile-file-form-defmumble, byte-compile, batch-byte-compile): Call
macroexp-strip-symbol-positions from code being passed to the native compiler.

* lisp/emacs-lisp/cl-macs.el (cl-macs--strip-s-p-1)
(cl-macs--strip-symbol-positions): Remove, replacing them with the renamed
functions in macroexp.el.
(cl-define-compiler-macro): Apply macroexp-strip-symbol-positions to ARGS and
BODY.

* lisp/emacs-lisp/comp.el (comp-limplify-lap-inst): Use `null' to compile
byte-not rather than a compilation of `eq'.
(comp--native-compile): bind symbols-with-pos-enabled to t.

* lisp/emacs-lisp/macroexp.el (byte-compile--ssp-conses-seen)
(byte-compile--ssp-vectors-seen, byte-compile--ssp-records-seen): Provisional
auxiliary variables to support the following functions.
(macroexp--strip-s-p-2, byte-compile-strip-s-p-1)
(macroexp-strip-symbol-positions): Functions moved from bytecomp.el, renamed,
and further developed.
(macroexp--compiler-macro): Bind symbol-with-pos-enabled to t around the call
to `handler'.
(internal-macroexpand-for-load): Strip symbol positions from the form being
eagerly expanded for macros.

* src/comp.c (F_SYMBOLS_WITH_POS_ENABLED_RELOC_SYM): New macro for a
relocation symbol.
(comp_t): New elements bool_ptr_type, f_symbols_with_pos_enabled_ref,
lisp_symbol_with_position, lisp_symbol_with_position_header,
lisp_symbol_with_position_sym, lisp_symbol_with_position_pos,
lisp_symbol_with_position_type, lisp_symbol_with_position_ptr_type,
get_symbol_with_position.
(helper_GET_SYMBOL_WITH_POSITION): New function.
(emit_BASE_EQ): Function rename from emit_EQ.
(emit_AND, emit_OR, emit_BARE_SYMBOL_P, emit_SYMBOL_WITH_POS_P)
(emit_SYMBOL_WITH_POS_SYM): New functions.
(emit_EQ): New function which handles symbols with position correctly.
(emit_NILP): Use emit_BASE_EQ rather than emit_EQ.
(emit_limple_insn): When emitting a conditional branch, check each operand for
being a literal Qnil, and if one of them is, use emit_BASE_EQ rather than
emit_EQ.
(declare_runtime_imported_funcs): Declare helper_GET_SYMBOL_WITH_POSITION.
(emit_ctxt_code): Export the global F_SYMBOLS_WITH_POS_ENABLED_RELOC_SYM.
(define_lisp_symbol_with_position, define_GET_SYMBOL_WITH_POSITION): New
functions.
(Fcomp__init_ctxt): Initialise comp.bool_ptr_type, call the two new
define_.... functions.
(load_comp_unit): Initialise **f_symbols_with_pos_enabled_reloc.

* src/fns.c (Fput): Strip positions from symbols in PROPNAME and VALUE.
2021-12-30 10:14:58 +00:00
..
advice.el ; More stylistic docfixes in emacs-lisp/*.el found by checkdoc 2021-09-18 13:14:50 +02:00
autoload.el Note that loaddefs.el is copied to ldefs-boot.el 2021-11-11 04:08:51 +01:00
avl-tree.el ; Minor stylistic fixes found by checkdoc 2021-10-05 02:06:57 +02:00
backquote.el Expand the ` doc string slightly 2021-09-26 08:47:08 +02:00
backtrace.el Make results details in ert-run-tests-batch configurable 2021-11-16 08:48:24 +01:00
benchmark.el * lisp/emacs-lisp/benchmark.el (benchmark-elapse): Tweak 2021-06-11 14:06:29 -04:00
bindat.el Several amendments to scratch/correct-warning-pos. 2021-12-01 20:03:44 +00:00
byte-opt.el First commit of scratch/correct-warning-pos. 2021-11-29 11:19:31 +00:00
byte-run.el Several amendments to scratch/correct-warning-pos. 2021-12-01 20:03:44 +00:00
bytecomp.el Make symbols with positions work with native compilation 2021-12-30 10:14:58 +00:00
cconv.el Several amendments to scratch/correct-warning-pos. 2021-12-01 20:03:44 +00:00
chart.el EIEIO: Promote the CLOS behavior over the EIEIO-specific behavior 2021-06-12 16:22:03 -04:00
check-declare.el ; More minor docfixes found by checkdoc 2021-09-14 07:57:14 +02:00
checkdoc.el * lisp/emacs-lisp/checkdoc.el (checkdoc-dired): Autoload. 2021-11-12 11:41:37 +01:00
cl-extra.el ; Minor stylistic fixes found by checkdoc 2021-10-05 02:06:57 +02:00
cl-generic.el Several amendments to scratch/correct-warning-pos. 2021-12-01 20:03:44 +00:00
cl-indent.el ; More minor docfixes found by checkdoc 2021-09-14 07:57:14 +02:00
cl-lib.el Move generalized variable specs from cl-lib.el to gv.el 2021-07-22 00:21:34 +02:00
cl-macs.el Make symbols with positions work with native compilation 2021-12-30 10:14:58 +00:00
cl-preloaded.el * lisp/emacs-lisp/cl-preloaded.el: Fix the format of props in slot-descs 2021-06-24 17:32:20 -04:00
cl-print.el Update copyright year to 2021 2021-01-01 01:13:56 -08:00
cl-seq.el Update copyright year to 2021 2021-01-01 01:13:56 -08:00
comp-cstr.el Don't quote nil and t in doc strings and comments 2021-09-21 22:11:43 +02:00
comp.el Make symbols with positions work with native compilation 2021-12-30 10:14:58 +00:00
copyright.el ; More minor docfixes found by checkdoc 2021-09-14 07:57:14 +02:00
crm.el Set minibuffer-completion-* variables locally in more places 2021-11-11 06:16:52 +01:00
cursor-sensor.el Update copyright year to 2021 2021-01-01 01:13:56 -08:00
debug.el Use format-prompt for many more prompts 2021-10-05 03:44:56 +02:00
derived.el Mark def* macros for indentation 2021-10-13 21:52:57 +02:00
disass.el ; More minor docfixes found by checkdoc 2021-09-14 07:57:14 +02:00
easy-mmode.el Several amendments to scratch/correct-warning-pos. 2021-12-01 20:03:44 +00:00
easymenu.el * lisp/emacs-lisp/easymenu.el (easy-menu-do-define): Fix bug#50051 2021-08-14 12:22:57 -04:00
edebug.el Use format-prompt for many more prompts 2021-10-05 03:44:56 +02:00
eieio-base.el ; More stylistic docfixes in emacs-lisp/*.el found by checkdoc 2021-09-18 13:14:50 +02:00
eieio-compat.el Mark def* macros for indentation 2021-10-13 21:52:57 +02:00
eieio-core.el Several amendments to scratch/correct-warning-pos. 2021-12-01 20:03:44 +00:00
eieio-custom.el ; More minor docfixes found by checkdoc 2021-09-14 07:57:14 +02:00
eieio-datadebug.el Update copyright year to 2021 2021-01-01 01:13:56 -08:00
eieio-opt.el Use string-search instead of string-match[-p] 2021-08-09 11:35:56 +02:00
eieio-speedbar.el Use string-search instead of string-match[-p] 2021-08-09 11:35:56 +02:00
eieio.el Several amendments to scratch/correct-warning-pos. 2021-12-01 20:03:44 +00:00
eldoc.el Fix eldoc usage of newly introduced variable 2021-11-18 10:35:12 +01:00
elint.el ; More stylistic docfixes in emacs-lisp/*.el found by checkdoc 2021-09-18 13:14:50 +02:00
elp.el Update elp-not-profilable 2021-10-18 10:40:08 +02:00
ert-x.el ; Fix some recent typos/thinkos. 2021-11-07 12:59:18 +02:00
ert.el Fixup for bug#51037 2021-11-18 17:03:43 +03:00
ewoc.el ; Minor stylistic fixes found by checkdoc 2021-10-05 02:06:57 +02:00
faceup.el Don't quote nil and t in doc strings and comments 2021-09-21 22:11:43 +02:00
find-func.el Make `find-function-source-path' into obsolete alias 2021-09-14 13:44:20 +02:00
float-sup.el * lisp/emacs-lisp/float-sup.el (pi): Actually mark it as obsolete 2021-04-12 12:53:53 -04:00
generator.el Improve doc strings of a recent commit 2021-09-18 14:56:55 +03:00
generic.el Prefer defvar-local in emacs-lisp/*.el 2021-01-31 14:55:53 +01:00
gv.el Several amendments to scratch/correct-warning-pos. 2021-12-01 20:03:44 +00:00
helper.el Use lexical-binding in all of lisp/emacs-lisp 2021-01-28 14:42:21 -05:00
hierarchy.el ; * etc/NEWS: Improve wording of an item. 2021-09-21 22:21:31 +02:00
inline.el * lisp/emacs-lisp/cconv.el: Improve line-nb info of unused var warnings 2021-02-26 20:24:52 -05:00
let-alist.el ; More minor docfixes found by checkdoc 2021-09-14 07:57:14 +02:00
lisp-mnt.el Add test for lm-website 2021-09-26 14:55:19 +02:00
lisp-mode.el Indent `closure' forms better 2021-11-25 14:41:45 +01:00
lisp.el Reformat up-list and backward-up-list doc strings 2021-09-02 10:22:52 +02:00
macroexp.el Make symbols with positions work with native compilation 2021-12-30 10:14:58 +00:00
map-ynp.el Use substitute-command-keys for literal key sequences 2021-11-22 12:04:19 +01:00
map.el * lisp/emacs-lisp/map.el: Restore compatibility with Emacs-26 2021-09-28 10:29:27 -04:00
memory-report.el Rename button-buttonize to buttonize 2021-11-04 18:14:29 +01:00
nadvice.el ; More stylistic docfixes in emacs-lisp/*.el found by checkdoc 2021-09-18 13:14:50 +02:00
package-x.el ; More minor docfixes found by checkdoc 2021-09-14 07:57:14 +02:00
package.el Merge from origin/emacs-28 2021-11-12 07:17:11 +01:00
pcase.el Several amendments to scratch/correct-warning-pos. 2021-12-01 20:03:44 +00:00
pp.el Fix pp-emacs-lisp-code for `when' and related 2021-11-07 02:44:42 +01:00
radix-tree.el Evaluate eql specializers 2021-08-03 18:26:15 -04:00
re-builder.el Use substitute-command-keys for literal key sequences 2021-11-22 12:04:19 +01:00
regexp-opt.el Update copyright year to 2021 2021-01-01 01:13:56 -08:00
regi.el Use lexical-binding in all of lisp/emacs-lisp 2021-01-28 14:42:21 -05:00
ring.el ; Remove some useless comments 2021-04-16 14:54:02 +02:00
rmc.el Fix a recent change in rmc.el 2021-05-07 17:09:44 +03:00
rx.el Add example of advanced user-defined Rx form to manual 2021-08-23 19:57:17 +02:00
seq.el Revert "Obsolete local set difference functions in favor of seq-difference" 2021-09-29 17:28:02 +02:00
shadow.el ; More minor docfixes found by checkdoc 2021-09-14 07:57:14 +02:00
shortdoc.el Make UCS compose/decompose functions more understandable 2021-11-19 07:46:06 +01:00
shorthands.el Move lisp/shorthands.el to lisp/emacs-lisp/shorthands.el 2021-10-29 14:37:08 +02:00
smie.el ; Minor stylistic fixes found by checkdoc 2021-10-05 02:06:57 +02:00
subr-x.el Remove APPEND argument from add-display-text-property 2021-11-24 20:10:17 +01:00
syntax.el Give 'syntax-propertize-wholelines' a docstring. 2021-05-30 22:38:48 +02:00
tabulated-list.el Support inserting images in tabulated-list-mode columns 2021-11-02 17:44:57 +01:00
tcover-ses.el ; Normalize and add missing first and last lines 2021-04-19 12:21:01 +02:00
testcover.el ; More stylistic docfixes in emacs-lisp/*.el found by checkdoc 2021-09-18 13:14:50 +02:00
text-property-search.el Even further `text-property-search-forward' clarifications 2021-05-12 19:01:53 +02:00
thunk.el ; More minor docfixes found by checkdoc 2021-09-14 07:57:14 +02:00
timer-list.el Update copyright year to 2021 2021-01-01 01:13:56 -08:00
timer.el ; Minor stylistic fixes found by checkdoc 2021-10-05 02:06:57 +02:00
tq.el Update copyright year to 2021 2021-01-01 01:13:56 -08:00
trace.el * lisp/emacs-lisp/trace.el (trace-values): Work outside of traced function 2021-03-02 09:13:57 -05:00
unsafep.el ; Normalize and add missing first and last lines 2021-04-19 12:21:01 +02:00
warnings.el Use string-search instead of string-match[-p] 2021-08-09 11:35:56 +02:00