emacs-diffs
[Top][All Lists]
Advanced

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

feature/native-comp 511415f 5/6: Store optimize qualities into .eln file


From: Andrea Corallo
Subject: feature/native-comp 511415f 5/6: Store optimize qualities into .eln files
Date: Wed, 26 Feb 2020 08:09:13 -0500 (EST)

branch: feature/native-comp
commit 511415f6f656a5bf4da4f5f49d58de9dc7d5d64d
Author: AndreaCorallo <address@hidden>
Commit: Andrea Corallo <address@hidden>

    Store optimize qualities into .eln files
    
    For now just comp-speed and comp-debug are stored.
---
 src/comp.c  | 10 ++++++++++
 src/comp.h  |  1 +
 src/print.c |  7 +++++--
 3 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/src/comp.c b/src/comp.c
index 9855e35..0fc6e41 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -47,6 +47,7 @@ along with GNU Emacs.  If not, see 
<https://www.gnu.org/licenses/>.  */
 #define TEXT_DATA_RELOC_SYM "text_data_reloc"
 #define TEXT_DATA_RELOC_IMPURE_SYM "text_data_reloc_imp"
 #define TEXT_DATA_RELOC_EPHEMERAL_SYM "text_data_reloc_eph"
+#define TEXT_OPTIM_QLY "text_optim_qly"
 
 #define SPEED XFIXNUM (Fsymbol_value (Qcomp_speed))
 #define COMP_DEBUG XFIXNUM (Fsymbol_value (Qcomp_debug))
@@ -1915,6 +1916,14 @@ declare_runtime_imported_funcs (void)
 static void
 emit_ctxt_code (void)
 {
+  /* Emit optimize qualities.  */
+  Lisp_Object opt_qly[] =
+    { Fcons (Qcomp_speed,
+            Fsymbol_value (Qcomp_speed)),
+      Fcons (Qcomp_debug,
+            Fsymbol_value (Qcomp_debug)) };
+  emit_static_object (TEXT_OPTIM_QLY, Flist (2, opt_qly));
+
   comp.current_thread_ref =
     gcc_jit_lvalue_as_rvalue (
       gcc_jit_context_new_global (
@@ -3414,6 +3423,7 @@ load_comp_unit (struct Lisp_Native_Comp_Unit *comp_u, 
bool loading_dump)
       /* Imported data.  */
       if (!loading_dump)
        {
+         comp_u->optimize_qualities = load_static_obj (comp_u, TEXT_OPTIM_QLY);
          comp_u->data_vec = load_static_obj (comp_u, TEXT_DATA_RELOC_SYM);
          comp_u->data_impure_vec =
            load_static_obj (comp_u, TEXT_DATA_RELOC_IMPURE_SYM);
diff --git a/src/comp.h b/src/comp.h
index 6019831..3aff440 100644
--- a/src/comp.h
+++ b/src/comp.h
@@ -36,6 +36,7 @@ struct Lisp_Native_Comp_Unit
   union vectorlike_header header;
   /* Original eln file loaded. */
   Lisp_Object file;
+  Lisp_Object optimize_qualities;
   /* Analogous to the constant vector but per compilation unit.  */
   Lisp_Object data_vec;
   /* Same but for data that cannot be moved to pure space.
diff --git a/src/print.c b/src/print.c
index ce8dd62..9b8308a 100644
--- a/src/print.c
+++ b/src/print.c
@@ -1840,8 +1840,11 @@ print_vectorlike (Lisp_Object obj, Lisp_Object 
printcharfun, bool escapeflag,
 #ifdef HAVE_NATIVE_COMP
     case PVEC_NATIVE_COMP_UNIT:
       {
-       print_c_string ("#<native compilation unit ", printcharfun);
-       print_string (XNATIVE_COMP_UNIT (obj)->file, printcharfun);
+       struct Lisp_Native_Comp_Unit *cu = XNATIVE_COMP_UNIT (obj);
+       print_c_string ("#<native compilation unit: ", printcharfun);
+       print_string (cu->file, printcharfun);
+       printchar (' ', printcharfun);
+       print_object (cu->optimize_qualities, printcharfun, escapeflag);
        printchar ('>', printcharfun);
       }
       break;



reply via email to

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