1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-30 12:21:25 -08:00

Merge 'scratch/no-purespace' into 'feature/igc'

This commit is contained in:
Pip Cet 2025-02-01 16:47:32 +00:00
commit f455ff2687
3 changed files with 26 additions and 10 deletions

View file

@ -42,6 +42,7 @@
(defvar comp-subr-arities-h)
(defvar native-comp-eln-load-path)
(defvar native-comp-enable-subr-trampolines)
(defvar comp--\#$)
(declare-function comp--compile-ctxt-to-file0 "comp.c")
(declare-function comp--init-ctxt "comp.c")
@ -3254,10 +3255,9 @@ Set it into the `type' slot."
;; from the corresponding m-var.
collect (if (gethash obj
(comp-ctxt-byte-func-to-func-h comp-ctxt))
;; Hack not to have `--lambda-fixup' in
;; data relocations as it would trigger the
;; check in 'check_comp_unit_relocs'.
(intern (concat (make-string 1 ?-) "-lambda-fixup"))
;; This prints as #$, so we can assert this
;; value does not remain in the data vector
comp--\#$
obj))))
(defun comp--finalize-relocs ()

View file

@ -471,7 +471,7 @@ load_gccjit_if_necessary (bool mandatory)
/* Increase this number to force a new Vcomp_abi_hash to be generated. */
#define ABI_VERSION "11"
#define ABI_VERSION "12"
/* Length of the hashes used for eln file naming. */
#define HASH_LENGTH 8
@ -2679,6 +2679,12 @@ emit_static_object (const char *name, Lisp_Object obj)
specbind (intern_c_string ("print-quoted"), Qt);
specbind (intern_c_string ("print-gensym"), Qt);
specbind (intern_c_string ("print-circle"), Qt);
/* Bind print-number-table and print-continuous-numbering so comp--#$
prints as #$. */
Lisp_Object print_number_table = CALLN (Fmake_hash_table, QCtest, Qeq);
Fputhash (Vcomp__hashdollar, build_string ("#$") , print_number_table);
specbind (intern_c_string ("print-number-table"), print_number_table);
specbind (intern_c_string ("print-continuous-numbering"), Qt);
Lisp_Object str = Fprin1_to_string (obj, Qnil, Qnil);
unbind_to (count, Qnil);
@ -5182,18 +5188,25 @@ typedef char *(*comp_lit_str_func) (void);
static Lisp_Object
load_static_obj (struct Lisp_Native_Comp_Unit *comp_u, const char *name)
{
specpdl_ref count = SPECPDL_INDEX ();
static_obj_t *blob =
dynlib_sym (comp_u->handle, format_string ("%s_blob", name));
/* Special value so we can recognize #$, which is used for entries in
the static vector that must be overwritten at load time. This is a
specific string that contains "#$", which is not EQ to any
legitimate object returned by Fread. */
specbind (intern_c_string ("load-file-name"),
Vcomp__hashdollar);
if (blob)
/* New blob format. */
return Fread (make_string (blob->data, blob->len));
return unbind_to (count, Fread (make_string (blob->data, blob->len)));
static_obj_t *(*f)(void) = dynlib_sym (comp_u->handle, name);
if (!f)
xsignal1 (Qnative_lisp_file_inconsistent, comp_u->file);
blob = f ();
return Fread (make_string (blob->data, blob->len));
return unbind_to (count, Fread (make_string (blob->data, blob->len)));
}
@ -5210,7 +5223,7 @@ check_comp_unit_relocs (struct Lisp_Native_Comp_Unit *comp_u)
for (ptrdiff_t i = 0; i < d_vec_len; i++)
{
Lisp_Object x = data_relocs[i];
if (EQ (x, Q__lambda_fixup))
if (EQ (x, Vcomp__hashdollar))
return false;
else if (NATIVE_COMP_FUNCTIONP (x))
{
@ -5692,7 +5705,6 @@ natively-compiled one. */);
DEFSYM (Qfixnum, "fixnum");
DEFSYM (Qscratch, "scratch");
DEFSYM (Qlate, "late");
DEFSYM (Q__lambda_fixup, "--lambda-fixup");
DEFSYM (Qgccjit, "gccjit");
DEFSYM (Qcomp_subr_trampoline_install, "comp-subr-trampoline-install");
DEFSYM (Qnative_comp_warning_on_missing_source,
@ -5883,6 +5895,10 @@ This is intended to be used only for development and
verification of the native compiler. */);
comp_sanitizer_active = false;
DEFVAR_LISP ("comp--#$", Vcomp__hashdollar,
doc: /* Special value which will print as "#$". */);
Vcomp__hashdollar = build_string ("#$");
Fprovide (intern_c_string ("native-compile"), Qnil);
#endif /* #ifdef HAVE_NATIVE_COMP */

View file

@ -5826,7 +5826,7 @@ dump_do_dump_relocation (const uintptr_t dump_base,
XSETSUBR (tem, subr);
Lisp_Object *fixup =
&(comp_u->data_relocs[XFIXNUM (lambda_data_idx)]);
eassert (EQ (*fixup, Q__lambda_fixup));
eassert (EQ (*fixup, Vcomp__hashdollar));
*fixup = tem;
Fputhash (tem, Qt, comp_u->lambda_gc_guard_h);
}