[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/native-comp e351a12 14/17: Sanity check on lambdas fixups
From: |
Andrea Corallo |
Subject: |
feature/native-comp e351a12 14/17: Sanity check on lambdas fixups |
Date: |
Fri, 15 May 2020 15:07:57 -0400 (EDT) |
branch: feature/native-comp
commit e351a12216519d3ed09892752ce0b137f6672986
Author: Andrea Corallo <address@hidden>
Commit: Andrea Corallo <address@hidden>
Sanity check on lambdas fixups
* src/pdumper.c (dump_do_dump_relocation): While fixing up lambda
relocation verify placeholder coherency.
* src/comp.c (syms_of_comp): Define symbol 'lambda-fixup'.
* lisp/emacs-lisp/comp.el (comp-finalize-container): Leave a
lambda-fixup as placeholder in the relocation as a sanity check.
---
lisp/emacs-lisp/comp.el | 2 +-
src/comp.c | 1 +
src/pdumper.c | 7 +++++--
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index d546218..7de8e01 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -2158,7 +2158,7 @@ These are substituted with a normal 'set' op."
;; from the corresponding m-var.
collect (if (gethash obj
(comp-ctxt-byte-func-to-func-h
comp-ctxt))
- nil
+ 'lambda-fixup
obj))))
(defun comp-finalize-relocs ()
diff --git a/src/comp.c b/src/comp.c
index 3a362fd..d1f8fe2 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -3891,6 +3891,7 @@ syms_of_comp (void)
DEFSYM (Qfixnum, "fixnum");
DEFSYM (Qscratch, "scratch");
DEFSYM (Qlate, "late");
+ DEFSYM (Qlambda_fixup, "lambda-fixup");
/* To be signaled by the compiler. */
DEFSYM (Qnative_compiler_error, "native-compiler-error");
diff --git a/src/pdumper.c b/src/pdumper.c
index a1b71e8..a6d12b6 100644
--- a/src/pdumper.c
+++ b/src/pdumper.c
@@ -5342,11 +5342,14 @@ dump_do_dump_relocation (const uintptr_t dump_base,
if (!NILP (lambda_data_idx))
{
/* This is an anonymous lambda.
- We must fixup data_vec so the lambda can be referenced
+ We must fixup d_reloc_imp so the lambda can be referenced
by code. */
Lisp_Object tem;
XSETSUBR (tem, subr);
- comp_u->data_imp_relocs[XFIXNUM (lambda_data_idx)] = tem;
+ Lisp_Object *fixup =
+ &(comp_u->data_imp_relocs[XFIXNUM (lambda_data_idx)]);
+ eassert (EQ (*fixup, Qlambda_fixup));
+ *fixup = tem;
Fputhash (tem, Qnil, comp_u->lambda_gc_guard);
}
break;
- feature/native-comp updated (28df049 -> d6f6353), Andrea Corallo, 2020/05/15
- feature/native-comp a335f7e 01/17: Update spill LAP machinery and compile anonymous lambdas, Andrea Corallo, 2020/05/15
- feature/native-comp acf7e12 04/17: * Rename emit_mvar_access -> emit_mvar_lval, Andrea Corallo, 2020/05/15
- feature/native-comp 3ab6a75 02/17: * Indentation fix, Andrea Corallo, 2020/05/15
- feature/native-comp 392a6f9 05/17: * Split emit_const_lisp_obj logic, Andrea Corallo, 2020/05/15
- feature/native-comp 5bf685f 03/17: * Rename emit_mvar_val -> emit_mvar_rval, Andrea Corallo, 2020/05/15
- feature/native-comp 49f0331 09/17: * Render all immediates as comments at comp-debug > 2, Andrea Corallo, 2020/05/15
- feature/native-comp 27b80ae 11/17: * Better Vcomp_sym_subr_c_name_h test function + doc, Andrea Corallo, 2020/05/15
- feature/native-comp 44b0ce6 10/17: Add anonymous lambdas reload mechanism, Andrea Corallo, 2020/05/15
- feature/native-comp e351a12 14/17: Sanity check on lambdas fixups,
Andrea Corallo <=
- feature/native-comp ff9e40e 15/17: * Add check_comp_unit_relocs, Andrea Corallo, 2020/05/15
- feature/native-comp 9a64585 16/17: * Allow for logging async compilation command line, Andrea Corallo, 2020/05/15
- feature/native-comp d6f6353 17/17: * Do not refuse to compile if a dynamic lambda is encountered, Andrea Corallo, 2020/05/15
- feature/native-comp c12831a 06/17: * Rework comp-spill-lap-function, Andrea Corallo, 2020/05/15
- feature/native-comp 2ee2fb5 07/17: * Prune now unnecessary byte-code objects, Andrea Corallo, 2020/05/15
- feature/native-comp 6eb14da 08/17: * Dump log and intemediate GCC IRs only at comp-debug 3, Andrea Corallo, 2020/05/15
- feature/native-comp e5b24b8 12/17: * Native compiler test update, Andrea Corallo, 2020/05/15
- feature/native-comp 2b064c7 13/17: * Fix speed 2 bootstrap, Andrea Corallo, 2020/05/15