* lisp/emacs-liqsp/comp.el (comp--jump-table-optimizable): Adjust
comment.
* src/category.c (hash_get_category_set):
* src/emacs-module.c (syms_of_module):
* src/fns.c (make_hash_table): Remove 'purecopy' flag and update
docstring.
(Fmake_hash_table): Ignore ':purecopy' argument.
* src/frame.c (make_frame):
* src/image.c (xpm_make_color_table_h):
* src/lisp.h (struct Lisp_Hash_Table): Drop 'purecopy' flag.
* src/pdumper.c (dump_hash_table): Don't dump 'purecopy' flag.
* src/print.c (print_object): Don't print 'purecopy' flag
* src/json.c (json_parse_object):
* src/lread.c (readevalloop, read_internal_start):
* src/pgtkterm.c (syms_of_pgtkterm):
* src/profiler.c (export_log):
* src/xfaces.c (syms_of_xfaces):
* src/xterm.c (syms_of_xterm): Adjust calls to 'make_hash_table'.
(cherry picked from commit
afd61deaaeb5e5e6845bdf995ac5ee9a3479599c)
(defun comp--jump-table-optimizable (jmp-table)
"Return t if JMP-TABLE can be optimized out."
;; Identify LAP sequences like:
- ;; (byte-constant #s(hash-table test eq purecopy t data (created 126 deleted 126 changed 126)) . 24)
+ ;; (byte-constant #s(hash-table test eq data (created 126 deleted 126 changed 126)) . 24)
;; (byte-switch)
;; (TAG 126 . 10)
(let ((targets (hash-table-values jmp-table)))
if (NILP (XCHAR_TABLE (table)->extras[1]))
set_char_table_extras
(table, 1,
- make_hash_table (&hashtest_equal, DEFAULT_HASH_SIZE, Weak_None, false));
+ make_hash_table (&hashtest_equal, DEFAULT_HASH_SIZE, Weak_None));
struct Lisp_Hash_Table *h = XHASH_TABLE (XCHAR_TABLE (table)->extras[1]);
hash_hash_t hash;
ptrdiff_t i = hash_lookup_get_hash (h, category_set, &hash);
{
staticpro (&Vmodule_refs_hash);
Vmodule_refs_hash
- = make_hash_table (&hashtest_eq, DEFAULT_HASH_SIZE, Weak_None, false);
+ = make_hash_table (&hashtest_eq, DEFAULT_HASH_SIZE, Weak_None);
DEFSYM (Qmodule_load_failed, "module-load-failed");
Fput (Qmodule_load_failed, Qerror_conditions,
Give the table initial capacity SIZE, 0 <= SIZE <= MOST_POSITIVE_FIXNUM.
- WEAK specifies the weakness of the table.
-
- If PURECOPY is non-nil, the table can be copied to pure storage via
- `purecopy' when Emacs is being dumped. Such tables can no longer be
- changed after purecopy. */
+ WEAK specifies the weakness of the table. */
Lisp_Object
make_hash_table (const struct hash_table_test *test, EMACS_INT size,
- hash_table_weakness_t weak, bool purecopy)
+ hash_table_weakness_t weak)
{
eassert (SYMBOLP (test->name));
eassert (0 <= size && size <= min (MOST_POSITIVE_FIXNUM, PTRDIFF_MAX));
}
h->next_weak = NULL;
- h->purecopy = purecopy;
h->mutable = true;
return make_lisp_hash_table (h);
}
WEAK. WEAK t is equivalent to `key-and-value'. Default value of WEAK
is nil.
-:purecopy PURECOPY -- If PURECOPY is non-nil, the table can be copied
-to pure storage when Emacs is being dumped, making the contents of the
-table read only. Any further changes to purified tables will result
-in an error.
-
-The keywords arguments :rehash-threshold and :rehash-size are obsolete
-and ignored.
+The keywords arguments :rehash-threshold, :rehash-size, and :purecopy
+are obsolete and ignored.
usage: (make-hash-table &rest KEYWORD-ARGS) */)
(ptrdiff_t nargs, Lisp_Object *args)
Lisp_Object test_arg = Qnil;
Lisp_Object weakness_arg = Qnil;
Lisp_Object size_arg = Qnil;
- Lisp_Object purecopy_arg = Qnil;
if (nargs & 1)
error ("Odd number of arguments");
weakness_arg = arg;
else if (BASE_EQ (kw, QCsize))
size_arg = arg;
- else if (BASE_EQ (kw, QCpurecopy))
- purecopy_arg = arg;
- else if (BASE_EQ (kw, QCrehash_threshold) || BASE_EQ (kw, QCrehash_size))
+ else if (BASE_EQ (kw, QCrehash_threshold) || BASE_EQ (kw, QCrehash_size)
+ || BASE_EQ (kw, QCpurecopy))
; /* ignore obsolete keyword arguments */
else
signal_error ("Invalid keyword argument", kw);
else
test = get_hash_table_user_test (test_arg);
- bool purecopy = !NILP (purecopy_arg);
-
EMACS_INT size;
if (NILP (size_arg))
size = DEFAULT_HASH_SIZE;
else
signal_error ("Invalid hash table weakness", weakness_arg);
- return make_hash_table (test, size, weak, purecopy);
+ return make_hash_table (test, size, weak);
}
rw->pixel_height = rw->total_lines * FRAME_LINE_HEIGHT (f);
fset_face_hash_table
- (f, make_hash_table (&hashtest_eq, DEFAULT_HASH_SIZE, Weak_None, false));
+ (f, make_hash_table (&hashtest_eq, DEFAULT_HASH_SIZE, Weak_None));
if (mini_p)
{
{
*put_func = xpm_put_color_table_h;
*get_func = xpm_get_color_table_h;
- return make_hash_table (&hashtest_equal, DEFAULT_HASH_SIZE, Weak_None, false);
+ return make_hash_table (&hashtest_equal, DEFAULT_HASH_SIZE, Weak_None);
}
static void
case json_object_hashtable:
{
EMACS_INT value = (parser->object_workspace_current - first) / 2;
- result = make_hash_table (&hashtest_equal, value, Weak_None, false);
+ result = make_hash_table (&hashtest_equal, value, Weak_None);
struct Lisp_Hash_Table *h = XHASH_TABLE (result);
for (size_t i = first; i < parser->object_workspace_current; i += 2)
{
/* Hash table test (only used when frozen in dump) */
ENUM_BF (hash_table_std_test_t) frozen_test : 2;
- /* True if the table can be purecopied. The table cannot be
- changed afterwards. */
- bool_bf purecopy : 1;
-
/* True if the table is mutable. Ordinarily tables are mutable, but
some tables are not: while a table is being mutated it is immutable
for recursive attempts to mutate it. */
EMACS_UINT hash_string (char const *, ptrdiff_t);
EMACS_UINT sxhash (Lisp_Object);
Lisp_Object make_hash_table (const struct hash_table_test *, EMACS_INT,
- hash_table_weakness_t, bool);
+ hash_table_weakness_t);
Lisp_Object hash_table_weakness_symbol (hash_table_weakness_t weak);
ptrdiff_t hash_lookup (struct Lisp_Hash_Table *, Lisp_Object);
ptrdiff_t hash_lookup_get_hash (struct Lisp_Hash_Table *h, Lisp_Object key,
if (! HASH_TABLE_P (read_objects_map)
|| XHASH_TABLE (read_objects_map)->count)
read_objects_map
- = make_hash_table (&hashtest_eq, DEFAULT_HASH_SIZE, Weak_None, false);
+ = make_hash_table (&hashtest_eq, DEFAULT_HASH_SIZE, Weak_None);
if (! HASH_TABLE_P (read_objects_completed)
|| XHASH_TABLE (read_objects_completed)->count)
read_objects_completed
- = make_hash_table (&hashtest_eq, DEFAULT_HASH_SIZE, Weak_None, false);
+ = make_hash_table (&hashtest_eq, DEFAULT_HASH_SIZE, Weak_None);
if (!NILP (Vpurify_flag) && c == '(')
val = read0 (readcharfun, false);
else
if (! HASH_TABLE_P (read_objects_map)
|| XHASH_TABLE (read_objects_map)->count)
read_objects_map
- = make_hash_table (&hashtest_eq, DEFAULT_HASH_SIZE, Weak_None, false);
+ = make_hash_table (&hashtest_eq, DEFAULT_HASH_SIZE, Weak_None);
if (! HASH_TABLE_P (read_objects_completed)
|| XHASH_TABLE (read_objects_completed)->count)
read_objects_completed
- = make_hash_table (&hashtest_eq, DEFAULT_HASH_SIZE, Weak_None, false);
+ = make_hash_table (&hashtest_eq, DEFAULT_HASH_SIZE, Weak_None);
if (STRINGP (stream)
|| ((CONSP (stream) && STRINGP (XCAR (stream)))))
dump_pseudovector_lisp_fields (ctx, &out->header, &hash->header);
DUMP_FIELD_COPY (out, hash, count);
DUMP_FIELD_COPY (out, hash, weakness);
- DUMP_FIELD_COPY (out, hash, purecopy);
DUMP_FIELD_COPY (out, hash, mutable);
DUMP_FIELD_COPY (out, hash, frozen_test);
if (hash->key_and_value)
DEFVAR_LISP ("pgtk-keysym-table", Vpgtk_keysym_table,
doc: /* Hash table of character codes indexed by X keysym codes. */);
- Vpgtk_keysym_table = make_hash_table (&hashtest_eql, 900, Weak_None, false);
+ Vpgtk_keysym_table = make_hash_table (&hashtest_eql, 900, Weak_None);
window_being_scrolled = Qnil;
staticpro (&window_being_scrolled);
printcharfun, escapeflag);
}
- if (h->purecopy)
- print_c_string (" purecopy t", printcharfun);
-
ptrdiff_t size = h->count;
if (size > 0)
{
the log but close enough, and will never confuse two distinct
keys in the log. */
Lisp_Object h = make_hash_table (&hashtest_equal, DEFAULT_HASH_SIZE,
- Weak_None, false);
+ Weak_None);
for (int i = 0; i < log->size; i++)
{
int count = get_log_count (log, i);
doc: /* Hash table of global face definitions (for internal use only.) */);
Vface_new_frame_defaults =
/* 33 entries is enough to fit all basic faces */
- make_hash_table (&hashtest_eq, 33, Weak_None, false);
+ make_hash_table (&hashtest_eq, 33, Weak_None);
DEFVAR_LISP ("face-default-stipple", Vface_default_stipple,
doc: /* Default stipple pattern used on monochrome displays.
DEFVAR_LISP ("x-keysym-table", Vx_keysym_table,
doc: /* Hash table of character codes indexed by X keysym codes. */);
- Vx_keysym_table = make_hash_table (&hashtest_eql, 900, Weak_None, false);
+ Vx_keysym_table = make_hash_table (&hashtest_eql, 900, Weak_None);
DEFVAR_BOOL ("x-frame-normalize-before-maximize",
x_frame_normalize_before_maximize,