]> git.eshelyaron.com Git - emacs.git/commitdiff
Merge branch 'master' into scratch/accurate-warning-pos
authorAlan Mackenzie <acm@muc.de>
Sat, 30 Mar 2019 17:25:53 +0000 (17:25 +0000)
committerAlan Mackenzie <acm@muc.de>
Sat, 30 Mar 2019 17:25:53 +0000 (17:25 +0000)
17 files changed:
1  2 
lisp/emacs-lisp/bytecomp.el
lisp/emacs-lisp/cconv.el
lisp/emacs-lisp/cl-generic.el
lisp/emacs-lisp/cl-macs.el
lisp/emacs-lisp/eieio-core.el
lisp/emacs-lisp/eieio.el
lisp/emacs-lisp/gv.el
lisp/emacs-lisp/macroexp.el
lisp/emacs-lisp/pcase.el
src/.gdbinit
src/alloc.c
src/data.c
src/fns.c
src/keyboard.c
src/lisp.h
src/lread.c
src/print.c

Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index e69f93c4eb9d2d134b456f3a6687883ad22e9f68,9af75320ec0d98e185401edb0e4cfe8de7abb471..b966d16ec48e1c64131b9910c78d9922abf858df
@@@ -250,17 -249,15 +250,17 @@@ Assumes the caller has bound `macroexpa
        ;; here, so that any code that cares about the difference will
        ;; see the same transformation.
        ;; First arg is a function:
-       (`(,(and fun (or `funcall `apply `mapcar `mapatoms `mapconcat `mapc))
+       (`(,(and fun (or 'funcall 'apply 'mapcar 'mapatoms 'mapconcat 'mapc))
           ',(and f `(lambda . ,_)) . ,args)
         (macroexp--warn-and-return
 +        (nth 1 f)
          (format "%s quoted with ' rather than with #'"
                  (list 'lambda (nth 1 f) '...))
          (macroexp--expand-all `(,fun ,f . ,args))))
        ;; Second arg is a function:
-       (`(,(and fun (or `sort)) ,arg1 ',(and f `(lambda . ,_)) . ,args)
+       (`(,(and fun (or 'sort)) ,arg1 ',(and f `(lambda . ,_)) . ,args)
         (macroexp--warn-and-return
 +        (nth 1 f)
          (format "%s quoted with ' rather than with #'"
                  (list 'lambda (nth 1 f) '...))
          (macroexp--expand-all `(,fun ,arg1 ,f . ,args))))
Simple merge
diff --cc src/.gdbinit
Simple merge
diff --cc src/alloc.c
index f37d7d48152fda3ef41926bbd298ae7ac4098585,e48807c49ad0022ef021e4ada9451b476f39cfcc..035b45864d96427ef9bbc0482cf0d03fa261ac47
@@@ -5997,16 -6258,47 +6273,49 @@@ where each entry has the form (NAME SIZ
    to return them to the OS).
  However, if there was overflow in pure space, `garbage-collect'
  returns nil, because real GC can't be done.
- See Info node `(elisp)Garbage Collection'.  */
-        attributes: noinline)
+ See Info node `(elisp)Garbage Collection'.  */)
    (void)
  {
-   void *end;
 +  ptrdiff_t count = SPECPDL_INDEX ();
-   SET_STACK_TOP_ADDRESS (&end);
-   /* return garbage_collect_1 (end); */
-   return unbind_to (count, garbage_collect_1 (end));
+   struct gcstat gcst;
 +  specbind (Qsymbols_with_pos_enabled, Qnil);
 -    return Qnil;
+   if (!garbage_collect_1 (&gcst))
 -  return CALLMANY (Flist, total);
++    return unbind_to (count, Qnil);
+   Lisp_Object total[] = {
+     list4 (Qconses, make_fixnum (sizeof (struct Lisp_Cons)),
+          make_int (gcst.total_conses),
+          make_int (gcst.total_free_conses)),
+     list4 (Qsymbols, make_fixnum (sizeof (struct Lisp_Symbol)),
+          make_int (gcst.total_symbols),
+          make_int (gcst.total_free_symbols)),
+     list4 (Qstrings, make_fixnum (sizeof (struct Lisp_String)),
+          make_int (gcst.total_strings),
+          make_int (gcst.total_free_strings)),
+     list3 (Qstring_bytes, make_fixnum (1),
+          make_int (gcst.total_string_bytes)),
+     list3 (Qvectors,
+          make_fixnum (header_size + sizeof (Lisp_Object)),
+          make_int (gcst.total_vectors)),
+     list4 (Qvector_slots, make_fixnum (word_size),
+          make_int (gcst.total_vector_slots),
+          make_int (gcst.total_free_vector_slots)),
+     list4 (Qfloats, make_fixnum (sizeof (struct Lisp_Float)),
+          make_int (gcst.total_floats),
+          make_int (gcst.total_free_floats)),
+     list4 (Qintervals, make_fixnum (sizeof (struct interval)),
+          make_int (gcst.total_intervals),
+          make_int (gcst.total_free_intervals)),
+     list3 (Qbuffers, make_fixnum (sizeof (struct buffer)),
+          make_int (gcst.total_buffers)),
+ #ifdef DOUG_LEA_MALLOC
+     list4 (Qheap, make_fixnum (1024),
+          make_int ((mallinfo ().uordblks + 1023) >> 10),
+          make_int ((mallinfo ().fordblks + 1023) >> 10)),
+ #endif
+   };
++  return unbind_to (count, CALLMANY (Flist, total));
  }
  
  /* Mark Lisp objects in glyph matrix MATRIX.  Currently the
@@@ -6081,8 -6378,8 +6395,8 @@@ mark_char_table (struct Lisp_Vector *pt
      {
        Lisp_Object val = ptr->contents[i];
  
-       if (FIXNUMP (val) || (BARE_SYMBOL_P (val)
-                             && XBARE_SYMBOL (val)->u.s.gcmarkbit))
+       if (FIXNUMP (val) ||
 -          (SYMBOLP (val) && symbol_marked_p (XSYMBOL (val))))
++          (BARE_SYMBOL_P (val) && symbol_marked_p (XBARE_SYMBOL (val))))
        continue;
        if (SUB_CHAR_TABLE_P (val))
        {
diff --cc src/data.c
index b437048e1ef06543574bc32ceb26404f5aa1b04f,15b6106cfe83524ac757a12119352d1607b0eebc..2ae5063d86e99362ed8a988db91c25172121d46f
@@@ -3995,11 -3956,10 +4025,11 @@@ syms_of_data (void
    DEFSYM (Qstring, "string");
    DEFSYM (Qcons, "cons");
    DEFSYM (Qmarker, "marker");
 +  DEFSYM (Qsymbol_with_pos, "symbol-with-pos");
    DEFSYM (Qoverlay, "overlay");
    DEFSYM (Qfinalizer, "finalizer");
- #ifdef HAVE_MODULES
    DEFSYM (Qmodule_function, "module-function");
+ #ifdef HAVE_MODULES
    DEFSYM (Quser_ptr, "user-ptr");
  #endif
    DEFSYM (Qfloat, "float");
diff --cc src/fns.c
index b5bf6ae76d5bd27b2a30a08b39c099d1e371bcb8,b97b132b0fe0d88d73ec963628e65446758fbe7f..b2810b53570f4d0034acd21f09fe5b805a9bb10b
+++ b/src/fns.c
@@@ -4141,8 -4145,8 +4152,10 @@@ hash_lookup (struct Lisp_Hash_Table *h
    EMACS_UINT hash_code;
    ptrdiff_t start_of_bucket, i;
  
 +  if (SYMBOL_WITH_POS_P (key))
 +      key = SYMBOL_WITH_POS_SYM (key);
+   hash_rehash_if_needed (h);
    hash_code = h->test.hashfn (&h->test, key);
    eassert ((hash_code & ~INTMASK) == 0);
    if (hash)
diff --cc src/keyboard.c
Simple merge
diff --cc src/lisp.h
index 6d2513e35c5311d71c44633d678d287c4cd87959,178eebed2a543daf9495b803bcd00e3f34725e09..3324dac98f6af0e36262c97cc63da352874a1a9a
@@@ -661,18 -622,113 +662,113 @@@ extern void char_table_set (Lisp_Object
  
  /* Defined in data.c.  */
  extern _Noreturn void wrong_type_argument (Lisp_Object, Lisp_Object);
 -
 +extern bool symbols_with_pos_enabled;
  
- #ifdef CANNOT_DUMP
- enum { might_dump = false };
- #elif defined DOUG_LEA_MALLOC
  /* Defined in emacs.c.  */
- extern bool might_dump;
- #endif
- /* True means Emacs has already been initialized.
-    Used during startup to detect startup of dumped Emacs.  */
+ /* Set after Emacs has started up the first time.
+    Prevents reinitialization of the Lisp world and keymaps on
+    subsequent starts.  */
  extern bool initialized;
  
+ extern struct gflags
+ {
+   /* True means this Emacs instance was born to dump.  */
+ #if defined HAVE_PDUMPER || defined HAVE_UNEXEC
+   bool will_dump_ : 1;
+   bool will_bootstrap_ : 1;
+ #endif
+ #ifdef HAVE_PDUMPER
+   /* Set in an Emacs process that will likely dump with pdumper; all
+      Emacs processes may dump with pdumper, however.  */
+   bool will_dump_with_pdumper_ : 1;
+   /* Set in an Emacs process that has been restored from a portable
+      dump.  */
+   bool dumped_with_pdumper_ : 1;
+ #endif
+ #ifdef HAVE_UNEXEC
+   bool will_dump_with_unexec_ : 1;
+   /* Set in an Emacs process that has been restored from an unexec
+      dump.  */
+   bool dumped_with_unexec_ : 1;
+   /* We promise not to unexec: useful for hybrid malloc.  */
+   bool will_not_unexec_ : 1;
+ #endif
+ } gflags;
+ INLINE bool
+ will_dump_p (void)
+ {
+ #if HAVE_PDUMPER || defined HAVE_UNEXEC
+   return gflags.will_dump_;
+ #else
+   return false;
+ #endif
+ }
+ INLINE bool
+ will_bootstrap_p (void)
+ {
+ #if HAVE_PDUMPER || defined HAVE_UNEXEC
+   return gflags.will_bootstrap_;
+ #else
+   return false;
+ #endif
+ }
+ INLINE bool
+ will_dump_with_pdumper_p (void)
+ {
+ #if HAVE_PDUMPER
+   return gflags.will_dump_with_pdumper_;
+ #else
+   return false;
+ #endif
+ }
+ INLINE bool
+ dumped_with_pdumper_p (void)
+ {
+ #if HAVE_PDUMPER
+   return gflags.dumped_with_pdumper_;
+ #else
+   return false;
+ #endif
+ }
+ INLINE bool
+ will_dump_with_unexec_p (void)
+ {
+ #ifdef HAVE_UNEXEC
+   return gflags.will_dump_with_unexec_;
+ #else
+   return false;
+ #endif
+ }
+ INLINE bool
+ dumped_with_unexec_p (void)
+ {
+ #ifdef HAVE_UNEXEC
+   return gflags.dumped_with_unexec_;
+ #else
+   return false;
+ #endif
+ }
+ /* This function is the opposite of will_dump_with_unexec_p(), except
+    that it returns false before main runs.  It's important to use
+    gmalloc for any pre-main allocations if we're going to unexec.  */
+ INLINE bool
+ definitely_will_not_unexec_p (void)
+ {
+ #ifdef HAVE_UNEXEC
+   return gflags.will_not_unexec_;
+ #else
+   return true;
+ #endif
+ }
  /* Defined in floatfns.c.  */
  extern double extract_float (Lisp_Object);
  
diff --cc src/lread.c
index 9609770cc322656b206f05def19e01cf27498542,2d64b638ff5d4d86d1f62fe813da1f97771f27b2..fcee7d4df7e655cbf8c5d11303d148e0a231f418
@@@ -2912,8 -2877,8 +2910,8 @@@ read1 (Lisp_Object readcharfun, int *pc
                {
                  /* Sub char-table can't be read as a regular
                     vector because of a two C integer fields.  */
 -                Lisp_Object tbl, tmp = read_list (1, readcharfun);
 +                Lisp_Object tbl, tmp = read_list (1, readcharfun, false);
-                 ptrdiff_t size = XFIXNUM (Flength (tmp));
+                 ptrdiff_t size = list_length (tmp);
                  int i, depth, min_char;
                  struct Lisp_Cons *cell;
  
@@@ -3880,25 -3842,18 +3878,18 @@@ string_to_number (char const *string, i
  
  \f
  static Lisp_Object
 -read_vector (Lisp_Object readcharfun, bool bytecodeflag)
 +read_vector (Lisp_Object readcharfun, bool bytecodeflag, bool locate_syms)
  {
-   ptrdiff_t i, size;
-   Lisp_Object *ptr;
-   Lisp_Object tem, item, vector;
-   struct Lisp_Cons *otem;
-   Lisp_Object len;
-   tem = read_list (1, readcharfun, locate_syms);
-   len = Flength (tem);
-   if (bytecodeflag && XFIXNAT (len) <= COMPILED_STACK_DEPTH)
 -  Lisp_Object tem = read_list (1, readcharfun);
++  Lisp_Object tem = read_list (1, readcharfun, locate_syms);
+   ptrdiff_t size = list_length (tem);
+   if (bytecodeflag && size <= COMPILED_STACK_DEPTH)
      error ("Invalid byte code");
-   vector = Fmake_vector (len, Qnil);
+   Lisp_Object vector = make_nil_vector (size);
  
-   size = XFIXNAT (len);
-   ptr = XVECTOR (vector)->contents;
-   for (i = 0; i < size; i++)
+   Lisp_Object *ptr = XVECTOR (vector)->contents;
+   for (ptrdiff_t i = 0; i < size; i++)
      {
-       item = Fcar (tem);
+       Lisp_Object item = Fcar (tem);
        /* If `load-force-doc-strings' is t when reading a lazily-loaded
         bytecode object, the docstring containing the bytecode and
         constants values must be treated as unibyte and passed to
diff --cc src/print.c
Simple merge