Commit graph

133960 commits

Author SHA1 Message Date
Eli Zaretskii
a25a9896d5 Minor type and signature fixes in jit.c
* src/jit.c (get_type) [!USE_LSB_TAG]: Use jit_type_void_ptr
for 'shift'.
(compile_wrong_type_argument): Use the correct signature for
wrong_type_argument native calls.
2018-09-09 19:10:36 +03:00
Eli Zaretskii
9efa35eea0 Fix types of Lisp objects in values and function calls
* src/jit.c (car_or_cdr, compile): Use lisp_object_type for
Lisp objects.
(init_jit): Define internal_catch_signature.
(compile): Use internal_catch_signature for 'internal_catch',
as ternary_signature doesn't fit.
2018-08-29 19:58:20 +03:00
Ken Brown
f6c33b4518 Fix 32-bit Cygwin builds with libjit
* src/lisp.h (USE_STACK_LISP_OBJECTS): Define to false for
32-bit Cygwin builds with libjit.
2018-08-27 10:03:54 -04:00
Eli Zaretskii
39c6bef858 Fix MS-Windows build with libjit
This fixes 32-bit MS-Windows build and hopefully also 64-bit
MS-Windows build (not tested).  32-bit MS-Windows build with wide ints
still doesn't work: I get invalid Lisp objects after JIT compiled code
is invoked.
* configure.ac (HAVE_LIBJIT) [mingw32]: Remove -ljit from
LIBJIT_LIBS, to avoid linking against libjit at build time and
allow loading libjit dynamically at run time.

* src/jit.c [WINDOWSNT]: Include w32.h and w32common.h.
[WINDOWSNT] (DEF_DLL_VAR, LOAD_DLL_VAR): New macros.
(init_libjit_functions) [WINDOWSNT]: New function.
(CONSTANT): A separate version for builds where EMACS_INT_MAX
is equal to INT_MAX (32-bit builds without wide ints).  Use
XLI when assigning Lisp objects to integer values.
(untag, compile_make_natnum, compile_make_number)
(unary_intmath): Handle the case of EMACS_INT_MAX > LONG_MAX.
(compile_current_thread, compile): Don't use CONSTANT for
anything that is not a Lisp object.
(emacs_jit_compile): Do nothing if jit-disable is non-nil.
Use XLP to assign and compare Lisp objects to pointers.
(syms_of_jit): New boolean variable jit-disable, by default nil.
(init_jit) [WINDOWSNT]: Call init_libjit_functions.
Define lisp_object_type separately for 64-bit Windows builds
and 32-bit builds with wide ints.  Fix some signatures to use
lisp_object_type and correct some that deviated from the
actual functions.
* src/lisp.h (USE_STACK_LISP_OBJECTS): Define to false for
32-bit MinGW builds with libjit.
* src/w32fns.c (syms_of_w32fns) <libjit>: New symbol.
* src/eval.c (Ffuncall, funcall_lambda): Use XLP to compare
Lisp_Object vs a pointer.
* src/emacs.c (main): Move the call to init_jit to before
init_buffer, as the latter calls Lisp and could use JIT.
* src/alloc.c (Fmake_byte_code): Use XPL to assign pointer to
a Lisp_Object field.

* lisp/term/w32-win.el (dynamic-library-alist): Add libjit-0.dll.
2018-08-23 19:40:19 +03:00
Eli Zaretskii
7fbcc5b533 Improve jit-disassemble-to-string
* src/jit.c (Fjit_disassemble_to_string) [!HAVE_OPEN_MEMSTREAM]:
Provide working code for systems that don't have 'open_memstream'.
2018-08-18 13:47:27 +03:00
Eli Zaretskii
9c0ed03e52 Fix 32-bit compilation on MS-Windows
* src/jit.c (CONSTANT): Avoid compilation warning on 32-bit
systems about casting a pointer to an integer of a different
size.
(compile) [HAVE__SETJMP]: Use _setjmp instead of setjmp, when
the latter is a macro.  Fixes a compilation error on system
that use _setjmp.
(Fjit_disassemble_to_string): Rearrange declaration to avoid
compilation warnings on systems that don't have open_memstream.
2018-08-18 12:18:54 +03:00
Tom Tromey
a166e8fabd JIT compiler
* lisp/emacs-lisp/jit-support.el: New file.
* src/alloc.c (make_byte_code): Remove.
(Fmake_byte_code): Rewrite.
* src/data.c (Fsubr_arity, notify_variable_watchers): Update.
* src/emacs.c (main): Call syms_of_jit, init_jit.
* src/eval.c (eval_sub, Fapply, FUNCTIONP, Ffuncall, funcall_subr)
(funcall_lambda): Update.
* src/jit.c: New file.
* src/lisp.h (struct subr_function): New struct, extracted from
Lisp_Subr.
(SUBR_MAX_ARGS): New define.
(struct Lisp_Subr): Use struct subr_function.
(COMPILED_JIT_CODE): New constant.
(DEFUN): Update.
(make_byte_code): Don't declare.
(funcall_subr): Add error_obj argument.
(syms_of_jit, init_jit, emacs_jit_compile): Declare.
* src/lread.c (read1): Use Fmake_byte_code.
* test/src/jit-tests.el: New file.
2018-08-13 18:11:39 -06:00
Tom Tromey
62d9c0cf9c Remove obsolete comment
* lisp/emacs-lisp/bytecomp.el (byte-compile-out-tag): Remove comment.
2018-08-13 18:11:39 -06:00
Tom Tromey
1bdba1a714 Add configury for JIT
* configure.ac: Add --with-libjit.  Check for open_memstream.
* src/Makefile.in (LIBJIT, LIBJIT_CFLAGS): New variables.
(EMACS_CFLAGS): Use LIBJIT_CFLAGS.
(base_obj): Add jit.o.
(LIBES): Use LIBJIT.
2018-08-13 18:11:39 -06:00
Tom Tromey
864fd8f133 Create bytecode.h
* src/bytecode.h: New file.
* src/bytecode.c: Move bytecode definitions to bytecode.h.
2018-08-13 18:11:39 -06:00
Paul Eggert
dc18a0917a Update doc strings for fixnum constants
* src/data.c (most-positive-fixnum, most-negative-fixnum):
Update doc strings in the light of fixnums.
2018-08-13 15:55:53 -07:00
Paul Eggert
76101698a7 Fix check for unsafe watch descriptor
* src/lisp.h (make_pointer_integer_unsafe): New function.
(make_pointer_integer): Use it.
* src/gfilenotify.c (dir_monitor_callback): Omit redundant eassert.
(Fgfile_add_watch): Signal an error instead of failing an
assertion if the pointer does not work.
2018-08-13 15:55:53 -07:00
Raimon Grau
eb787d749f Add uuid as allowed thingatpt symbol (Bug#32372)
* etc/NEWS: Mention changes in thingatpt.el.
* lisp/thingatpt.el (thing-at-point-uuid-regexp): Add regexp for uuid.
(top-level): Add 'bounds-of-thing-at-point' operation for 'uuid'.
* test/lisp/thingatpt-tests.el: Add tests for uuid at point.
2018-08-13 07:46:35 -04:00
Paul Eggert
a1e0868f74 Pacify gcc -Og -Wuninitialized
This addresses the -Og uninitialized variable warnings I ran
into on Fedora 28, which uses 8.1.1 20180712 (Red Hat 8.1.1-5).
It also changes some explicit initializations to UNINIT
when the variable does not actually need to be initialized.
* src/process.c (connect_network_socket):
* src/sysdep.c (system_process_attributes):
* src/xfns.c (x_real_pos_and_offsets):
* src/xterm.c (get_current_wm_state) [USE_XCB]:
Add UNINIT.
* src/editfns.c (tzlookup):
* src/fns.c (Fnconc):
* src/font.c (font_parse_fcname):
* src/frame.c (x_set_frame_parameters):
Prefer UNINIT to explicit initialization.
2018-08-12 17:25:54 -07:00
Paul Eggert
ca10011898 * configure.ac (GMP_LIB): Set to -lgmp if --without-mini-gmp. 2018-08-12 17:14:59 -07:00
Paul Eggert
a84cef9095 Port better to x86 -fexcess-precision=fast
Problem reported by Eli Zaretskii in:
https://lists.gnu.org/r/emacs-devel/2018-08/msg00380.html
* src/data.c (arithcompare): Work around incompatibility
between gcc -fexcess-precision=fast and the C standard on x86,
by capturing the results of floating-point comparisons before
the excess precision spontaneously decays.  Although this fix
might not work in general, it does work here and is probably
good enough for the platforms we care about.
2018-08-12 15:31:28 -07:00
Stephen Berman
2b1cac2685 Update and improve todo-mode item insertion and editing code
* lisp/calendar/todo-mode.el (todo-insert-item--param-key-alist)
(todo-insert-item--keyof, todo-insert-item--this-key)
(todo-insert-item--keys-so-far, todo-insert-item--args)
(todo-insert-item--argleft. todo-insert-item--argsleft)
(todo-insert-item--newargsleft, todo-insert-item--apply-args)
(todo-edit-item--param-key-alist, todo-edit-item--prompt)
(todo-edit-item--date-param-key-alist)
(todo-edit-done-item--param-key-alist): Remove.
(todo-insert-item--next-param): Reimplement to take advantage of
lexical binding.
(todo-insert-item): Adjust to new implementation of the above.
(todo-edit-item--next-key): Incorporate now removed global
variables, adjust signature accordingly, update use of pcase.
(todo-edit-item): Adjust to changed signature of the above.
2018-08-12 23:25:53 +02:00
Paul Eggert
f99ee7378f Adjust .gdbinit to removal of misc objects
* src/.gdbinit (xtype, xpr): Adjust.
(xmisctype, xmiscfree): Remove.
2018-08-12 11:46:26 -07:00
Paul Eggert
d966f8d291 Make mini-gmp safe for --enable-gcc-warnings
* configure.ac (GMP_OBJ): When building mini-gmp, compile
mini-gmp-emacs.c, not mini-gmp.c.
* lib-src/etags.c (NDEBUG): Don't attempt to redefine, in
case the builder compiles with -DNDEBUG.
* src/conf_post.h (NDEBUG) [!ENABLE_CHECKING && !NDEBUG]: Define.
This avoids bloat in mini-gmp-emacs.o.
* src/mini-gmp-emacs.c: New file, which pacifies --enable-gcc-warnings.
2018-08-12 11:13:15 -07:00
Eli Zaretskii
135037397a Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs 2018-08-12 19:03:27 +03:00
Eli Zaretskii
d9806a55a0 ; Avoid compilation warnings under -Og
* src/w32.c (w32_read_registry):
* src/font.c (font_parse_fcname):
* src/fns.c (Fnconc):
* src/editfns.c (tzlookup):
* src/frame.c (x_set_frame_parameters): Avoid compiler warnings
about maybe-uninitialized variables.
2018-08-12 19:02:32 +03:00
Paul Eggert
21c2fd724d Fix typo caught by zsh
* lisp/Makefile.in (compile-clean): Fix typo; missing ";" (Bug#32423).
2018-08-12 09:01:20 -07:00
Michael Albinus
4532def340 ; Remove instrumentation for Bug#32226 2018-08-12 17:38:24 +02:00
João Távora
6a7c84d095 jsonrpc-shutdown's cleanup also kills stderr buffer
* lisp/jsonrpc.el
(Version): Bump to 1.0.6
(jsonrpc-shutdown): Also kill stderr buffer
2018-08-12 13:26:06 +01:00
João Távora
a5cd6cb2b5 Revert "Make jsonrpc-shutdown a noop if process isn't running"
This reverts commit c580443325.  It
leads to situations where the sentinel hasn't run yet, which brings
problems if the normal process isn't running, but the stderr
pseudo-process still is.

* lisp/jsonrpc.el (jsonrpc-shutdown): Always enter loop.
2018-08-12 13:25:05 +01:00
Andreas Schwab
a04829d1b4 Ensure no padding after union vectorlike_header
Instead of increasing GCALIGNMENT align union vectorlike_header by
adding a Lisp_Object member.

* src/lisp.h (GCALIGNMENT): Revert last change.
(union vectorlike_header): Add align member.
(header_size): Verify the same as sizeof (union
vectorlike_header)
2018-08-12 12:07:00 +02:00
Andreas Schwab
3d0a0ca7ca Avoid padding after union vectorlike_header
The PSEUDOVECTORSIZE macro requires that the first member after union
vectorlike_header has the same offset in all pseudo vector structures.

* src/lisp.h (GCALIGNMENT) [!USE_LSB_TAG]: Use alignment of
Lisp_Object.
2018-08-12 11:12:27 +02:00
Paul Eggert
3fc948a36c New 'configure' arg --with-mini-gmp
* configure.ac: It lets the builder override default of whther
mini-gmp is used.  Use AC_SEARCH_LIBS as per Autoconf manual.
2018-08-12 01:07:02 -07:00
Paul Eggert
d64c1be990 Update from Gnulib
This incorporates:
2018-08-11 verify: port 'assume' to traditional tools
* build-aux/config.sub, lib/regcomp.c, lib/verify.h:
Copy from Gnulib.
* lib/gnulib.mk.in: Regenerate.
2018-08-11 19:08:29 -07:00
Paul Eggert
1145bd0ef9 Remove stray union Lisp_Misc doc (Bug#32405#35). 2018-08-11 18:50:25 -07:00
Paul Eggert
6c12f4e63f Simplify mark_object for pseudovectors
Suggested by Pip Cet (Bug#32405#14).
* src/alloc.c (mark_object): Remove unnecessary special cases for
PVEC_MARKER, PVEC_BOOL_VECTOR, PVEC_MISC_PTR, PVEC_USER_PTR, and
PVEC_FINALIZER.

change is to free up an enum Lisp_Type tag value, a scarce
2018-08-11 18:50:25 -07:00
Paul Eggert
d614e4a8cd Turn misc objects into pseudovectors
Eliminate the category of miscellaneous objects, and turn all
such objects into pseudovectors.  The immediate motivation
for this change is to free up an enum Lisp_Type tag value, a
scarce resource that can be better used elsewhere.  However,
this change is worthwhile in its own right, as it improves
performance slightly on my platform, 0.3% faster for 'make
compile-always' on Fedora 28, and it simplifies the garbage
collector and interpreter (Bug#32405).
* doc/lispref/internals.texi (Garbage Collection):
* etc/NEWS:
Document change to garbage-collect return value.
* src/alloc.c (total_markers, total_free_markers):
(union aligned_Lisp_Misc, MARKER_BLOCK_SIZE)
(struct marker_block, marker_block, marker_block_index)
(misc_free_list, allocate_misc, live_misc_holding)
(live_misc_p, sweep_misc):
* src/lisp.h (lisp_h_MARKERP, lisp_h_MISCP, MARKERP, MISCP)
(Lisp_Misc, enum Lisp_Misc_Type, Lisp_Misc_Free)
(Lisp_Misc_Marker, Lisp_Misc_Overlay, Lisp_Misc_Finalizer)
(Lisp_Misc_Ptr, Lisp_Misc_User_Ptr, Lisp_Misc_Limit)
(Lisp_Misc_Bignum)
(XSETMISC, struct Lisp_Misc_Any, XMISCANY, XMISCTYPE)
(struct Lisp_Free, union Lisp_Misc, XMISC):
Remove.  All uses removed.
(cleanup_vector): Clean up objects that were formerly misc
and are now pseudovectors.
(make_misc_ptr, build_overlay, Fmake_marker, build_marker)
(make_bignum_str, make_number, make_pure_bignum)
(make_user_ptr, Fmake_finalizer):
Build as pseudovectors, not as misc objects.
(mark_finalizer_list, queue_doomed_finalizers)
(compact_undo_list, mark_overlay, mark_object)
(unchain_dead_markers):
Mark as vector-like objects, not as misc objects.
(mark_maybe_object, mark_maybe_pointer, valid_lisp_object_p)
(total_bytes_of_live_objects, survives_gc_p):
* src/fns.c (sxhash):
No need to worry about misc objects.
(garbage_collect_1): Do not generate a 'misc' component.
(syms_of_alloc): No need for 'misc' symbol.
* src/buffer.c (overlays_at, overlays_in, overlay_touches_p)
(overlay_strings, recenter_overlay_lists)
(fix_start_end_in_overlays, fix_overlays_before)
(Foverlay_lists, report_overlay_modification)
(evaporate_overlays):
* src/editfns.c (overlays_around):
* src/data.c (Ftype_of):
* src/fns.c (internal_equal):
* src/lisp.h (mint_ptrp, xmint_pointer, FINALIZERP)
(XFINALIZER, MARKERP, XMARKER, OVERLAYP, XOVERLAY, USER_PTRP)
(XUSER_PTR, BIGNUMP, XBIGNUM):
* src/print.c (print_vectorlike, print_object):
* src/undo.c (record_marker_adjustments):
* src/xdisp.c (load_overlay_strings):
Formerly misc objects are now pseudovectors.
* src/lisp.h (PVEC_MARKER, PVEC_OVERLAY, PVEC_FINALIZER)
(PVEC_BIGNUM, PVEC_MISC_PTR, PVEC_USER_PTR):
New constants, replacing their misc versions.  All uses changed.
(struct Lisp_Marker, struct Lisp_Overlay, struct Lisp_Misc_Ptr)
(struct Lisp_Bignum, struct Lisp_User_Ptr, struct Lisp_Finalizer):
Make usable as a pseudovector by using a pseudovector header,
replacing any DIY components, and putting Lisp_Object members
first.  All uses changed.
2018-08-11 18:50:25 -07:00
Paul Eggert
d3ec5117da Pacify Oracle Studio 12.6
* src/xfns.c (Fx_frame_restack):
* src/xterm.c (x_io_error_quitter): Omit unreachable code.
2018-08-11 16:32:52 -07:00
Paul Eggert
da7fc851dc Reject old libgmp that lack mpz_roinit_n
* configure.ac (HAVE_GMP): Port to RHEL 6.9, which has
libgmp 3.5, which predates mpz_roinit_n.
2018-08-11 16:28:19 -07:00
Glenn Morris
d0d7bd6816 ; * test/lisp/international/ccl-tests.el: Add license notice. 2018-08-11 14:44:49 -07:00
Tom Tromey
78ec68e18f Merge branch 'feature/bignum' 2018-08-11 13:34:17 -06:00
Michael Albinus
ba1c4f63e3 Fix Bug#32226, hopefully
* test/lisp/shadowfile-tests.el: Set Tramp variables for hydra.
2018-08-11 20:30:39 +02:00
João Távora
bf1298c7d8 Fix blunder in last commit for lisp/jsonrpc.el
* lisp/jsonrpc.el (jsonrpc-shutdown): Use jsonrpc--process.
2018-08-11 17:08:13 +01:00
João Távora
2304bc9b97 Add option to cleanup buffers to jsonrpc-shutdown
* lisp/jsonrpc.el (Version): Bump to 1.0.5
(jsonrpc-shutdown): Add an option to cleanup process buffer.
2018-08-11 17:02:23 +01:00
Michael Albinus
1d8fa1c981 ; More instrumentation for shadowfile-tests.el and files.el 2018-08-11 17:03:41 +02:00
João Távora
d7b9737e69 * lisp/jsonrpc.el (jsonrpc-request): Clarify comment. 2018-08-11 14:57:01 +01:00
João Távora
c580443325 Make jsonrpc-shutdown a noop if process isn't running
* lisp/jsonrpc.el
(Version): Bump to 1.0.4
(jsonrpc-shutdown): Noop if server isn't running.
2018-08-11 14:57:01 +01:00
Andy Moreton
914b0300bc Avoid calling vc backend if 'vc-display-status' is nil
* lisp/vc/vc-hooks.el (vc-mode-line): Avoid calling VC backend if
'vc-display-status' is nil.  (Bug#32225)
2018-08-11 13:04:06 +03:00
Eli Zaretskii
eefa51689c Give auto-save-no-message a proper version attribute
* lisp/cus-start.el (standard): Give 'auto-save-no-message' the
proper version attribute.  (Bug#31039)
2018-08-11 12:55:52 +03:00
Federico Tedin
c024a05e59 Add variable auto-save-no-message
* src/keyboard.c (auto-save-no-message): New variable, allows
suppressing auto-saving message.
* lisp/cus-start.el (standard): Add 'auto-save-no-message' variable.
* doc/emacs/files.texi (Auto Save): Document 'auto-save-no-message'.
* etc/NEWS: Mention 'auto-save-no-message'.  (Bug#31039)
2018-08-11 12:24:04 +03:00
Michael Albinus
33344ab911 Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs 2018-08-11 10:26:20 +02:00
Michael Albinus
e9cda7a9d4 ; More instrumentation for files.el 2018-08-11 10:25:55 +02:00
Eli Zaretskii
e33534f26a Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs 2018-08-11 11:19:27 +03:00
Eli Zaretskii
5fbf13038d Reinstate the 'tis620-2533' character set
This is a partial revert of "Make 'tis620-2533' character set be an
alias for 'thai-iso8859-11'" commit from Jul 28, 2018.
* lisp/international/mule-conf.el (tis620-2533): No longer an
alias for thai-iso8859-11.  Instead, reinstate the original
definition of tis620-2533, but without eight-bit-control in
the :superset attribute.  For the details, see
http://lists.gnu.org/archive/html/emacs-devel/2018-08/msg00117.html
and the surrounding discussions.
* lisp/international/fontset.el (font-encoding-alist)
(font-encoding-charset-alist): Reinstate tis620-2533 charset.
* lisp/language/thai.el (thai-tis620): Restore the original
:charset-list.
("Thai"): Restore the original nonascii-translation.
* lisp/w32-fns.el: Use tis620-2533 instead of thai-iso8859-11.
2018-08-11 11:15:57 +03:00
Michael Albinus
a0d00f17dd Editorial changes in tramp.texi
* doc/misc/tramp.texi (Bug Reports): Tramp buffers shall be
appended as attachments to bug reports.
(Frequently Asked Questions): New item, determining remote buffers.
2018-08-11 09:51:27 +02:00