emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

scratch/igc 060ed640afc: Don't access other MPS objects in fix_comp_unit


From: Gerd Moellmann
Subject: scratch/igc 060ed640afc: Don't access other MPS objects in fix_comp_unit
Date: Tue, 30 Apr 2024 14:28:30 -0400 (EDT)

branch: scratch/igc
commit 060ed640afc2f181a8f6becf8af6294674e5cf3e
Author: Gerd Möllmann <gerd@gnu.org>
Commit: Gerd Möllmann <gerd@gnu.org>

    Don't access other MPS objects in fix_comp_unit
---
 src/.lldbinit | 10 +++++++---
 src/comp.c    | 10 ++++++++++
 src/comp.h    |  4 ++++
 src/igc.c     | 12 +++++++++---
 4 files changed, 30 insertions(+), 6 deletions(-)

diff --git a/src/.lldbinit b/src/.lldbinit
index 243191ab1b3..923faea975c 100644
--- a/src/.lldbinit
+++ b/src/.lldbinit
@@ -75,8 +75,12 @@ b die
 #settings set -- target.run-args --module-assertions --no-init-file 
--no-site-file --no-site-lisp -L ":." -l ert --eval "(setq 
treesit-extra-load-path '(\"/Users/gerd/.emacs.d/tree-sitter\"))" -l 
lisp/emacs-lisp/package-tests --batch --eval '(ert-run-tests-batch-and-exit 
(quote (not (or (tag :expensive-test) (tag :unstable) (tag :nativecomp)))))'
 
 # Von Helmut:
-target create emacs
-command alias go process launch --tty --working-dir .
-settings set -- target.run-args -Q --eval '(progn (view-hello-file) 
(redisplay) (igc--collect) (forward-line))'
+#target create emacs
+#command alias go process launch --tty --working-dir .
+#settings set -- target.run-args -Q --eval '(progn (view-hello-file) 
(redisplay) (igc--collect) (forward-line))'
+
+target create temacs
+settings set -- target.run-args --batch  -l loadup --temacs=pbootstrap 
--bin-dest /Users/gerd/emacs/savannah/igc/nextstep/Emacs.app/Contents/MacOS/ 
--eln-dest 
/Users/gerd/emacs/savannah/igc/nextstep/Emacs.app/Contents/Frameworks/
+command alias go process launch --working-dir .
 
 # end.
diff --git a/src/comp.c b/src/comp.c
index a783d486378..0e5908aaaf7 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -5412,10 +5412,16 @@ load_comp_unit (struct Lisp_Native_Comp_Unit *comp_u, 
bool loading_dump,
        }
 
       EMACS_INT d_vec_len = XFIXNUM (Flength (comp_u->data_vec));
+#ifdef HAVE_MPS
+      comp_u->n_data_relocs = d_vec_len;
+#endif
       for (EMACS_INT i = 0; i < d_vec_len; i++)
        data_relocs[i] = AREF (comp_u->data_vec, i);
 
       d_vec_len = XFIXNUM (Flength (comp_u->data_impure_vec));
+#ifdef HAVE_MPS
+      comp_u->n_data_imp_relocs = d_vec_len;
+#endif
       for (EMACS_INT i = 0; i < d_vec_len; i++)
        data_imp_relocs[i] = AREF (comp_u->data_impure_vec, i);
     }
@@ -5444,6 +5450,10 @@ load_comp_unit (struct Lisp_Native_Comp_Unit *comp_u, 
bool loading_dump,
          EMACS_INT d_vec_len = XFIXNUM (Flength (data_ephemeral_vec));
          for (EMACS_INT i = 0; i < d_vec_len; i++)
            data_eph_relocs[i] = AREF (data_ephemeral_vec, i);
+# ifdef HAVE_MPS
+         comp_u->data_eph_relocs = data_eph_relocs;
+         comp_u->n_data_eph_relocs = d_vec_len;
+# endif
        }
       /* Executing this will perform all the expected environment
         modifications.  */
diff --git a/src/comp.h b/src/comp.h
index e881b15aee8..bb84999f529 100644
--- a/src/comp.h
+++ b/src/comp.h
@@ -48,7 +48,11 @@ struct Lisp_Native_Comp_Unit
   /* STUFFS WE DO NOT DUMP!!  */
   Lisp_Object *data_imp_relocs;
 # ifdef HAVE_MPS
+  size_t n_data_imp_relocs;
   Lisp_Object *data_relocs;
+  size_t n_data_relocs;
+  Lisp_Object *data_eph_relocs;
+  size_t n_data_eph_relocs;
 # endif
   bool loaded_once;
   bool load_ongoing;
diff --git a/src/igc.c b/src/igc.c
index 568a310f1ce..3127a9cd5ff 100644
--- a/src/igc.c
+++ b/src/igc.c
@@ -1592,14 +1592,19 @@ fix_comp_unit (mps_ss_t ss, struct 
Lisp_Native_Comp_Unit *u)
     IGC_FIX_CALL_FN (ss, struct Lisp_Vector, u, fix_vectorlike);
     if (u->data_imp_relocs)
       {
-       size_t n = ASIZE (u->data_impure_vec);
+       size_t n = u->n_data_imp_relocs;
        IGC_FIX12_NOBJS (ss, u->data_imp_relocs, n);
       }
     if (u->data_relocs)
       {
-       size_t n = ASIZE (u->data_vec);
+       size_t n = u->n_data_relocs;
        IGC_FIX12_NOBJS (ss, u->data_relocs, n);
       }
+    if (u->data_eph_relocs)
+      {
+       size_t n = u->n_data_eph_relocs;
+       IGC_FIX12_NOBJS (ss, u->data_eph_relocs, n);
+      }
   }
   MPS_SCAN_END (ss);
   return MPS_RES_OK;
@@ -2279,8 +2284,9 @@ static void
 finalize_comp_unit (struct Lisp_Native_Comp_Unit *u)
 {
   unload_comp_unit (u);
+  u->data_eph_relocs = NULL;
+  u->data_imp_relocs = NULL;
   u->data_imp_relocs = NULL;
-  u->data_relocs = NULL;
 }
 
 static void



reply via email to

[Prev in Thread] Current Thread [Next in Thread]