]> git.eshelyaron.com Git - emacs.git/commitdiff
Store optimize qualities into .eln files
authorAndreaCorallo <akrl@sdf.org>
Tue, 25 Feb 2020 22:37:20 +0000 (22:37 +0000)
committerAndrea Corallo <akrl@sdf.org>
Wed, 26 Feb 2020 12:57:45 +0000 (12:57 +0000)
For now just comp-speed and comp-debug are stored.

src/comp.c
src/comp.h
src/print.c

index 9855e352785a41b62bc5248c9dadbcf37043bf3d..0fc6e412924a4f17ede5b704c48009a080bb282c 100644 (file)
@@ -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);
index 6019831bc30da812c8b4bcd257225e2fad961e17..3aff440ecb749147acf91ed68b47a9a95d78d42d 100644 (file)
@@ -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.
index ce8dd625b685296e5d094811939d85a2640d8087..9b8308a675818c0504da11f8cebc12a02cb2678b 100644 (file)
@@ -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;