aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreaCorallo2020-02-25 22:37:20 +0000
committerAndrea Corallo2020-02-26 12:57:45 +0000
commit511415f6f656a5bf4da4f5f49d58de9dc7d5d64d (patch)
tree92fbc78682e8e51589e88199115752ab626e7713
parent6898161a2b4d6af2d4b4b8f20a813304938bed53 (diff)
downloademacs-511415f6f656a5bf4da4f5f49d58de9dc7d5d64d.tar.gz
emacs-511415f6f656a5bf4da4f5f49d58de9dc7d5d64d.zip
Store optimize qualities into .eln files
For now just comp-speed and comp-debug are stored.
-rw-r--r--src/comp.c10
-rw-r--r--src/comp.h1
-rw-r--r--src/print.c7
3 files changed, 16 insertions, 2 deletions
diff --git a/src/comp.c b/src/comp.c
index 9855e352785..0fc6e412924 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/>. */
47#define TEXT_DATA_RELOC_SYM "text_data_reloc" 47#define TEXT_DATA_RELOC_SYM "text_data_reloc"
48#define TEXT_DATA_RELOC_IMPURE_SYM "text_data_reloc_imp" 48#define TEXT_DATA_RELOC_IMPURE_SYM "text_data_reloc_imp"
49#define TEXT_DATA_RELOC_EPHEMERAL_SYM "text_data_reloc_eph" 49#define TEXT_DATA_RELOC_EPHEMERAL_SYM "text_data_reloc_eph"
50#define TEXT_OPTIM_QLY "text_optim_qly"
50 51
51#define SPEED XFIXNUM (Fsymbol_value (Qcomp_speed)) 52#define SPEED XFIXNUM (Fsymbol_value (Qcomp_speed))
52#define COMP_DEBUG XFIXNUM (Fsymbol_value (Qcomp_debug)) 53#define COMP_DEBUG XFIXNUM (Fsymbol_value (Qcomp_debug))
@@ -1915,6 +1916,14 @@ declare_runtime_imported_funcs (void)
1915static void 1916static void
1916emit_ctxt_code (void) 1917emit_ctxt_code (void)
1917{ 1918{
1919 /* Emit optimize qualities. */
1920 Lisp_Object opt_qly[] =
1921 { Fcons (Qcomp_speed,
1922 Fsymbol_value (Qcomp_speed)),
1923 Fcons (Qcomp_debug,
1924 Fsymbol_value (Qcomp_debug)) };
1925 emit_static_object (TEXT_OPTIM_QLY, Flist (2, opt_qly));
1926
1918 comp.current_thread_ref = 1927 comp.current_thread_ref =
1919 gcc_jit_lvalue_as_rvalue ( 1928 gcc_jit_lvalue_as_rvalue (
1920 gcc_jit_context_new_global ( 1929 gcc_jit_context_new_global (
@@ -3414,6 +3423,7 @@ load_comp_unit (struct Lisp_Native_Comp_Unit *comp_u, bool loading_dump)
3414 /* Imported data. */ 3423 /* Imported data. */
3415 if (!loading_dump) 3424 if (!loading_dump)
3416 { 3425 {
3426 comp_u->optimize_qualities = load_static_obj (comp_u, TEXT_OPTIM_QLY);
3417 comp_u->data_vec = load_static_obj (comp_u, TEXT_DATA_RELOC_SYM); 3427 comp_u->data_vec = load_static_obj (comp_u, TEXT_DATA_RELOC_SYM);
3418 comp_u->data_impure_vec = 3428 comp_u->data_impure_vec =
3419 load_static_obj (comp_u, TEXT_DATA_RELOC_IMPURE_SYM); 3429 load_static_obj (comp_u, TEXT_DATA_RELOC_IMPURE_SYM);
diff --git a/src/comp.h b/src/comp.h
index 6019831bc30..3aff440ecb7 100644
--- a/src/comp.h
+++ b/src/comp.h
@@ -36,6 +36,7 @@ struct Lisp_Native_Comp_Unit
36 union vectorlike_header header; 36 union vectorlike_header header;
37 /* Original eln file loaded. */ 37 /* Original eln file loaded. */
38 Lisp_Object file; 38 Lisp_Object file;
39 Lisp_Object optimize_qualities;
39 /* Analogous to the constant vector but per compilation unit. */ 40 /* Analogous to the constant vector but per compilation unit. */
40 Lisp_Object data_vec; 41 Lisp_Object data_vec;
41 /* Same but for data that cannot be moved to pure space. 42 /* Same but for data that cannot be moved to pure space.
diff --git a/src/print.c b/src/print.c
index ce8dd625b68..9b8308a6758 100644
--- a/src/print.c
+++ b/src/print.c
@@ -1840,8 +1840,11 @@ print_vectorlike (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag,
1840#ifdef HAVE_NATIVE_COMP 1840#ifdef HAVE_NATIVE_COMP
1841 case PVEC_NATIVE_COMP_UNIT: 1841 case PVEC_NATIVE_COMP_UNIT:
1842 { 1842 {
1843 print_c_string ("#<native compilation unit ", printcharfun); 1843 struct Lisp_Native_Comp_Unit *cu = XNATIVE_COMP_UNIT (obj);
1844 print_string (XNATIVE_COMP_UNIT (obj)->file, printcharfun); 1844 print_c_string ("#<native compilation unit: ", printcharfun);
1845 print_string (cu->file, printcharfun);
1846 printchar (' ', printcharfun);
1847 print_object (cu->optimize_qualities, printcharfun, escapeflag);
1845 printchar ('>', printcharfun); 1848 printchar ('>', printcharfun);
1846 } 1849 }
1847 break; 1850 break;