summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* * Fix bug#42360Andrea Corallo2020-07-151-6/+41
| | | | | | | * src/comp.c (compile_function): Allocate function frame as array if non local exits are present to retain correct Elisp semantic. (emit_limple_call_ref): Directly use the frame array for ref calls to have GCC spills into it before calling.
* Merge remote-tracking branch 'savahnna/master' into HEADAndrea Corallo2020-07-137-4917/+11
|\
| * Merge from origin/emacs-27Glenn Morris2020-07-112-1/+8
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | c04b92104c Add commentary in gtkutil.c 6290850dac Consistently stylize eldoc as ElDoc in prose 136e931189 Improve documentation of "C-u C-x =" 1f52771fd3 Mention floating rounding issues c892ae65b4 Repair global-auto-revert-ignore-modes (bug#42271) 3a446a02fb ; * src/xdisp.c (decode_mode_spec): Fix commentary. 79f381b4a6 One more improvement of left/right-fringe display spec docs 1279bdb072 Another clarification of left/right-fringe display spec # Conflicts: # doc/emacs/programs.texi
| | * Add commentary in gtkutil.cEli Zaretskii2020-07-111-0/+7
| | | | | | | | | | | | | | | * src/gtkutil.c: Add a comment regarding the incompatibilities vis-a-vis GTK. Suggested by Richard Stallman <rms@gnu.org>.
| | * ; * src/xdisp.c (decode_mode_spec): Fix commentary.Eli Zaretskii2020-07-081-1/+1
| | |
| * | Use Gnulib libgmp modulePaul Eggert2020-07-095-4916/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of doing GMP by hand, use the Gnulib libgmp module. * .gitignore: Add lib/gmp.h. * admin/merge-gnulib (GNULIB_MODULES): Add libgmp. * configure.ac (GMP_LIB, GMP_OBJ): Remove. Gnulib uses the name LIB_GMP, so all uses changed. All uses of GMP_OBJ removed. (HAVE_GMP): Set this from Gnulib’s variables. * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate. * lib/mini-gmp-gnulib.c, lib/mini-gmp.c, lib/mini-gmp.h, m4/libgmp.m4: New files, copied from Gnulib. * src/bignum.h, test/data/emacs-module/mod-test.c: Include gmp.h unconditionally. * src/mini-gmp-emacs.c, src/mini-gmp.c, src/mini-gmp.h: Remove. This moves these files from src to lib, and updates them to the current GMP version. * test/Makefile.in (GMP_H): New macro. ($(test_module)): Use it to decide whether to compile mini-gmp-gnulib.c too.
* | | * Rework frame allocation strategyAndrea Corallo2020-07-131-61/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All frame slots are now simple automatic variables given the array allocation and fill is done in 'emit_limple_call_ref'. * src/comp.c (comp_t): Remove 'f_frame' 'arrays' slots, add 'frame'. (emit_mvar_lval): Simplify to make use of 'comp.frame'. (compile_function): Clean-up and add comp.frame initialization.
* | | * Rework the backend to allocate arument arrays for call by referencesAndrea Corallo2020-07-131-20/+40
| | | | | | | | | | | | | | | | | | | | | * src/comp.c (comp_t): Add 'zero' field. (emit_limple_call_ref): Allocate an array to host the parametes and generate the code moving values into. (Fcomp__init_ctxt): Initialize comp.zero.
* | | Merge remote-tracking branch 'savannah/master' into wip2Andrea Corallo2020-07-091-0/+14
|\| |
| * | Special-case symbol and fixnum keys in member, assoc and rassocMattias Engdegård2020-07-081-0/+14
| | | | | | | | | | | | | | | | | | * src/fns.c (Fmember, Fassoc, Frassoc): Delegate to the cheaper Fmemq, Fassq and Frassq for arguments of the appropriate types. (eq_comparable_value): New function.
* | | Merge remote-tracking branch 'savannah/master' into HEADAndrea Corallo2020-07-073-5/+26
|\| |
| * | Merge from origin/emacs-27Glenn Morris2020-07-071-0/+16
| |\| | | | | | | | | | | | | | | | | | | 71fc003860 (origin/emacs-27) Avoid infloop in 'format-mode-line' 247dcb4b1b Clarify the documentation of 'left/right-fringe' display spec d453cee177 Minor improvement in ELisp manual 3c778c443c * doc/misc/tramp.texi (Customizing Methods): Fix typo.
| | * Avoid infloop in 'format-mode-line'Eli Zaretskii2020-07-071-0/+16
| | | | | | | | | | | | | | | * src/xdisp.c (decode_mode_spec): Don't use W->start if it is outside of the buffer's accessible region. (Bug#42220)
| * | Merge from origin/emacs-27Glenn Morris2020-07-073-5/+10
| |\| | | | | | | | | | | | | | | | | | | | | | 59e768d64a Fix undefined behavior in json.c (Bug#42113) cce00bef03 Fix ACTION argument of 'display-buffer' call in gud.el 0121db2702 * src/keyboard.c (Fclear_this_command_keys): Doc fix. b9abf5ceb2 Improve do string of 'man' b87fc938a0 ; * src/xdisp.c (pos_visible_p): Yet another minor fix for...
| | * Fix undefined behavior in json.c (Bug#42113)Philipp Stephani2020-06-291-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | * src/json.c (lisp_to_json_toplevel_1, Fjson_parse_string): Check whether input strings are actually strings. * test/src/json-tests.el (json-parse-string/wrong-type) (json-serialize/wrong-hash-key-type): New regression tests.
| | * * src/keyboard.c (Fclear_this_command_keys): Doc fix.Eli Zaretskii2020-06-271-1/+1
| | |
| | * ; * src/xdisp.c (pos_visible_p): Yet another minor fix for bug#42039.Eli Zaretskii2020-06-261-4/+7
| | |
* | | Merge remote-tracking branch 'savahnna/master' into HEADAndrea Corallo2020-07-022-15/+0
|\| |
| * | MS-Windows fixes as followup to import of Gnulib 'getrandom'Eli Zaretskii2020-06-282-15/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * nt/mingw-cfg.site (gl_cv_lib_assume_bcrypt): Set to "no" to disable linking against bcrypt.dll. (Bug#42095) * src/gnutls.c (gnutls_rnd) [WINDOWSNT]: Don't define a function pointer, and don't load it from GnuTLS DLL. (w32_gnutls_rnd) [WINDOWSNT]: Delete unused function. * src/fns.c (gnutls_rnd) [WINDOWSNT]: Don't redirect to w32_gnutls_rnd.
* | | Revert "* src/comp.c (Fcomp__register_subr): Remove code duplication using ↵Andrea Corallo2020-06-291-1/+11
| | | | | | | | | | | | | | | | | | Fdefalias." This reverts commit 6c7f615ae59b636efe5012f761a25acfd956480d.
* | | * Enable deferred compilation for dynamic scoped codeAndrea Corallo2020-06-281-1/+8
| | | | | | | | | | | | | | | * src/comp.c (maybe_defer_native_compilation): Trigger for dynamic code and add a comment.
* | | Merge remote-tracking branch 'savannah/master' into uninternedAndrea Corallo2020-06-283-31/+24
|\| |
| * | Add thread-naming support for OpenBSDTimo Myyrä2020-06-281-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | OpenBSD has pthread_set_name_np; FreeBSD appears to have both this call and pthread_setname_np (the latter call is used in preference). * configure.ac: Detect pthread_set_name_np. * sys/systhread.c: Include <pthread_np.h> and call pthread_set_name_np if available.
| * | Use getrandom syscall for noncesPaul Eggert2020-06-272-31/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * admin/merge-gnulib (GNULIB_MODULES): Add getrandom. * doc/lispref/text.texi (Format of GnuTLS Cryptography Inputs): Don’t say that iv-auto uses GNUTLS_RND_NONCE. Also, don’t say that it returns the IV’s actual value, as it never has done that. * src/fns.c, src/sysdep.c: Include sys/random.h, for getrandom. * src/fns.c (Fsecure_hash_algorithms): Use getrandom so that this function does not depend on HAVE_GNUTLS3. * src/sysdep.c: Do not include <gnutls/crypto.h>. (random_seed) [HAVE_LRAND48]: Can be long int now. (init_random) [!WINDOWSNT]: Use getrandom syscall instead of opening /dev/urandom, as this works even on GNU/Linux hosts that lack /dev/urandom. Don’t bother with gnutls_rnd as it’s not needed now that we have getrandom.
* | | * src/comp.c (Fcomp__register_subr): Remove code duplication using Fdefalias.Andrea Corallo2020-06-281-11/+1
| | |
* | | * Setup correctly the printer while dumping objs in native CU (bug#42088)Andrea Corallo2020-06-281-0/+12
| | | | | | | | | | | | | | | | | | | | | * src/comp.c (emit_static_object): Bind a bunch of special variables to setup `prin1-to-string' as `byte-compile-output-file-form' does. This to preserve uninterned symbols.
* | | Merge remote-tracking branch 'savannah/master' into HEADAndrea Corallo2020-06-273-44/+54
|\| |
| * | Merge from origin/emacs-27Glenn Morris2020-06-262-3/+5
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5280e118c0 (origin/emacs-27) ; * src/xdisp.c (pos_visible_p): Fix las... bb1a9481c9 Fix posn-at-point at beginning of a display string 0c4b033670 Improve documentation of Info node movement commands 632b0119e1 Add Jansson dependency to Windows Build dbfcdab837 Unbreak 'reverse-region' c37de84845 Fix typos and markup in fill column indicator docs f61bff3ee9 ; * CONTRIBUTE: Clarify the preferences for patch formatting. 368e140660 Avoid crashes in 'defconst' 11e3413cff Fix text about Lisp archives in the Emacs FQ 4c81724675 Don't use 'cl' functions in ELisp manual's examples
| | * ; * src/xdisp.c (pos_visible_p): Fix last change. (Bug#42039)Eli Zaretskii2020-06-261-13/+4
| | |
| | * Fix posn-at-point at beginning of a display stringEli Zaretskii2020-06-261-4/+14
| | | | | | | | | | | | | | | * src/xdisp.c (pos_visible_p): Account for the line-number width when the display string at CHARPOS ends in a newline. (Bug#42039)
| | * Avoid crashes in 'defconst'Stephen Berman2020-06-201-0/+1
| | | | | | | | | | | | | | | * src/eval.c (Fdefconst): Verify that SYMBOL is a known symbol. (Bug#41817)
| * | Minor improvements as followup to recent RGB string-parsing changeEli Zaretskii2020-06-221-41/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/xfaces.c (Finternal_color_values_from_color_spec): Rename to... (Fcolor_values_from_color_spec): ...this. Callers changed. Rename the argument to SPEC and improve the doc string. (parse_color_spec, parse_float_color_comp, parse_hex_color_comp): Improve commentary. (parse_color_spec): Rename the argument S to SPEC. * etc/NEWS: Mention 'color-values-from-color-spec'.
* | | src/comp.c (Fcomp__register_subr): Handle advice activation (bug#42038).Andrea Corallo2020-06-271-1/+9
| | |
* | | Merge remote-tracking branch 'savahnna/master' into devAndrea Corallo2020-06-227-237/+173
|\| |
| * | Consolidate #RGB string parsersMattias Engdegård2020-06-215-230/+155
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use a single parser of color strings in the #RGB, rgb:R/G/B and rgbi:R/G/B formats, replacing four existing ones. Previously, error-checking was spotty, handling of the rgbi: format not always present, and normalization of the result was sometimes incorrect. * src/dispextern.h: New prototype. * src/xfaces.c (parse_hex_color_comp, parse_float_color_comp) (parse_color_spec, Finternal-color_values_from_color_spec): New functions. * test/src/xfaces-tests.el (xfaces-internal-color-values-from-color-spec): New test. * lisp/term/tty-colors.el (tty-color-standard-values): Use internal-color-values-from-color-spec, replacing old parser. * src/nsterm.m (ns_get_color): * src/w32fns.c (x_to_w32_color): * src/xterm.c (x_parse_color): Use parse_color_spec, replacing old parsers. (HEX_COLOR_NAME_LENGTH): Remove #define.
| * | Add fallback for 24-bit terminal color via COLORTERM=truecolorJan Beich2020-06-201-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/term.c (init_tty): When COLORTERM=truecolor is defined, override setaf/setab/colors terminfo capabilities with 24-bit color support. * doc/misc/efaq.texi (Colors on a TTY): Mention the possibility to enable 24-bit color via the COLORTERM environment variable. (Bug#41846) Copyright-paperwork-exempt: yes
| * | Check AREF and aref_addr subscriptsPaul Eggert2020-06-181-7/+9
| | | | | | | | | | | | | | | | | | * src/lisp.h (gc_asize): Move before first use. (AREF, aref_addr): Check subscripts. Co-authored-by: Tino Calancha <tino.calancha@gmail.com>
* | | Two `load-history' eln related fixes.Andrea Corallo2020-06-221-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | * src/lread.c (Fload): Fix `load-history' filling for elns non in root lisp-dir. * lisp/startup.el (command-line): Fix `load-history' fixup algorith for eln files.
* | | ;* src/comp.c (define_maybe_gc_or_quit): Fix a comment.Andrea Corallo2020-06-221-2/+2
| | |
* | | * src/comp.c (Fcomp__compile_ctxt_to_file): Confine gcc optim level in [0, 3].Andrea Corallo2020-06-221-1/+2
| | |
* | | Allow per function speed declarationAndrea Corallo2020-06-221-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/comp.c (COMP_SPEED): Rename. (comp_t): Add 'func_speed' field. (emit_mvar_lval, compile_function): Update for per function speed. (Fcomp__compile_ctxt_to_file): COMP_SPEED renamed. * lisp/emacs-lisp/comp.el (comp-speed): Doc update. (comp-func): New 'speed' slot. (comp-spill-speed): New function. (comp-spill-lap-function, comp-intern-func-in-ctxt): Fill 'speed' slot. (comp-spill-lap-function): Gate -1 speed functions for native compilation and emit bytecode instead. (comp-spill-lap): Close over `byte-to-native-plist-environment'. (comp-latch-make-fill): Update for per function speed. (comp-limplify-top-level): Fill speed. (comp-propagate1, comp-call-optim-form-call, comp-call-optim) (comp-dead-code, comp-tco, comp-remove-type-hints): Update for per function speed.
* | | Add native compiler dynamic scope supportAndrea Corallo2020-06-195-27/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an initial implementation to support dynamic scope. Arg parsing/binding it's done using the existing code in use for bytecode (no ad-hoc code is synthetized for that). * src/lisp.h (struct Lisp_Subr): Add lambda_list field. (SUBR_NATIVE_COMPILED_DYNP): New inliner. * src/alloc.c (mark_object): Update for Add lambda_list field. * src/eval.c (eval_sub, Ffuncall, funcall_lambda): Handle native compiled dynamic scope * src/comp.c (declare_lex_function): Rename from declare_function and rework. (declare_function): New function. (make_subr): Handle daynamic scope * src/pdumper.c (dump_subr): Update for lambda_list field. * lisp/emacs-lisp/comp.el (comp-func): Remove args slot. (comp-func-l, comp-func-d): New classes deriving from `comp-func'. (comp-spill-lap-function): Rework. (comp-prepare-args-for-top-level): New function. (comp-emit-for-top-level, comp-emit-lambda-for-top-level): Make use of `comp-prepare-args-for-top-level'. (comp-limplify-top-level): Use `comp-func-l'. (comp-limplify-function): Emit arg prologue only for dynamic scoped functions. (comp-call-optim-form-call): Use `comp-func-l'. (comp-call-optim, comp-tco): Do not optimize dynamic scoped code.
* | | * Implement 'maybe_gc_or_quit' to allow correct GC in compiled Lisp.Andrea Corallo2020-06-131-1/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement the backend side of 'maybe_gc_or_quit' so that every time a call to it is emitted we render it accordingly. This allow GC to kicks in during long loops in Lisp code. * src/comp.c (comp_t): Add 'maybe_gc_or_quit' field. (helper_link_table): Add 'maybe_gc', 'maybe_quit'. (emit_maybe_gc_or_quit): New function. (declare_runtime_imported_funcs): Import 'maybe_gc', 'maybe_quit' functions. (define_maybe_gc_or_quit): New function. (Fcomp__init_ctxt): Register emitter. (Fcomp__compile_ctxt_to_file): Call 'define_maybe_gc_or_quit'. (syms_of_comp): Define Qcomp_maybe_gc_or_quit.
* | | Fix const qualifier warningsAndrea Corallo2020-06-132-2/+4
| | | | | | | | | | | | | | | | | | | | | * src/lisp.h (struct Lisp_Subr): Remove const qualifier from 'native_c_name'. * src/alloc.c (cleanup_vector): Cast to discard const qualifier.
* | | * src/alloc.c (cleanup_vector): Fix --enable-check-lisp-object-type build.Andrea Corallo2020-06-131-1/+1
| | |
* | | Merge remote-tracking branch 'savahnna/master' into HEADAndrea Corallo2020-06-111-9/+12
|\| |
| * | More robust NS hex colour string parsingMattias Engdegård2020-06-081-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Invalid arguments to color-values, such as "#abcdefg" or "#1234", or valid ones like "#111222333", should not yield nonsense values. * src/nsterm.m (ns_get_color): Only accept "#RGB" strings with 1-4 digits per components, equal number of digits each, and no trailing characters. Parse 12-bit colours correctly.
* | | * Fix memory leak when native compiled function is collectedAndrea Corallo2020-06-111-0/+11
| | | | | | | | | | | | | | | * src/alloc.c (cleanup_vector): Handle native compiled functions.
* | | Fix recursive load for non cons hashed 'data_ephemeral_vec' contentAndrea Corallo2020-06-112-8/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Remove `Vcomp_sym_subr_c_name_h'Andrea Corallo2020-06-113-16/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Given there's no more unique relation symbol-name -> c-name remove `Vcomp_sym_subr_c_name_h' and store the c_name directly in struct Lisp_Subr. The old approach would have failed dumping two functions with the same symbol-name. * src/lisp.h (struct Lisp_Subr): Add 'native_c_name' field. * src/pdumper.c (dump_subr): Update hash + dump 'native_c_name'. (dump_cold_native_subr): dump 'native_c_name'. (dump_do_dump_relocation): Update logic for reviving using 'native_c_name'. * src/comp.c (make_subr): Update for 'native_c_name' field. (Fcomp__register_lambda, Fcomp__register_subr): Clean-up code for 'Vcomp_sym_subr_c_name_h' removal. (syms_of_comp): Remove 'Vcomp_sym_subr_c_name_h'.