diff options
| author | Andrea Corallo | 2022-08-17 22:29:33 +0200 |
|---|---|---|
| committer | Andrea Corallo | 2022-08-18 11:03:25 +0200 |
| commit | aea05a5dec90c36fa12e0622234a12fbf0a403f3 (patch) | |
| tree | 5ac15abb42cdae9c76cc3effd445a827e34bd964 /src/comp.c | |
| parent | 9f26a8d31b1c7e6a596ca0933f327df5ac60463d (diff) | |
| download | emacs-aea05a5dec90c36fa12e0622234a12fbf0a403f3.tar.gz emacs-aea05a5dec90c36fa12e0622234a12fbf0a403f3.zip | |
* Expose `comp-loaded-comp-units-h'
* src/comp.c : remove 'all_loaded_comp_units_h'.
(syms_of_comp): Define `comp-loaded-comp-units-h'.
(register_native_comp_unit, Fnative_elisp_load): Use it.
Diffstat (limited to 'src/comp.c')
| -rw-r--r-- | src/comp.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/comp.c b/src/comp.c index 21d2ee5300b..70e7d5a8bbf 100644 --- a/src/comp.c +++ b/src/comp.c | |||
| @@ -5017,8 +5017,6 @@ helper_GET_SYMBOL_WITH_POSITION (Lisp_Object a) | |||
| 5017 | 5017 | ||
| 5018 | /* `native-comp-eln-load-path' clean-up support code. */ | 5018 | /* `native-comp-eln-load-path' clean-up support code. */ |
| 5019 | 5019 | ||
| 5020 | static Lisp_Object all_loaded_comp_units_h; | ||
| 5021 | |||
| 5022 | #ifdef WINDOWSNT | 5020 | #ifdef WINDOWSNT |
| 5023 | static Lisp_Object | 5021 | static Lisp_Object |
| 5024 | return_nil (Lisp_Object arg) | 5022 | return_nil (Lisp_Object arg) |
| @@ -5060,11 +5058,12 @@ eln_load_path_final_clean_up (void) | |||
| 5060 | } | 5058 | } |
| 5061 | 5059 | ||
| 5062 | /* This function puts the compilation unit in the | 5060 | /* This function puts the compilation unit in the |
| 5063 | `all_loaded_comp_units_h` hashmap. */ | 5061 | `Vcomp_loaded_comp_units_h` hashmap. */ |
| 5064 | static void | 5062 | static void |
| 5065 | register_native_comp_unit (Lisp_Object comp_u) | 5063 | register_native_comp_unit (Lisp_Object comp_u) |
| 5066 | { | 5064 | { |
| 5067 | Fputhash (XNATIVE_COMP_UNIT (comp_u)->file, comp_u, all_loaded_comp_units_h); | 5065 | Fputhash ( |
| 5066 | XNATIVE_COMP_UNIT (comp_u)->file, comp_u, Vcomp_loaded_comp_units_h); | ||
| 5068 | } | 5067 | } |
| 5069 | 5068 | ||
| 5070 | 5069 | ||
| @@ -5552,7 +5551,7 @@ LATE_LOAD has to be non-nil when loading for deferred compilation. */) | |||
| 5552 | struct Lisp_Native_Comp_Unit *comp_u = allocate_native_comp_unit (); | 5551 | struct Lisp_Native_Comp_Unit *comp_u = allocate_native_comp_unit (); |
| 5553 | Lisp_Object encoded_filename = ENCODE_FILE (filename); | 5552 | Lisp_Object encoded_filename = ENCODE_FILE (filename); |
| 5554 | 5553 | ||
| 5555 | if (!NILP (Fgethash (filename, all_loaded_comp_units_h, Qnil)) | 5554 | if (!NILP (Fgethash (filename, Vcomp_loaded_comp_units_h, Qnil)) |
| 5556 | && !file_in_eln_sys_dir (filename) | 5555 | && !file_in_eln_sys_dir (filename) |
| 5557 | && !NILP (Ffile_writable_p (filename))) | 5556 | && !NILP (Ffile_writable_p (filename))) |
| 5558 | { | 5557 | { |
| @@ -5754,10 +5753,6 @@ compiled one. */); | |||
| 5754 | staticpro (&loadsearch_re_list); | 5753 | staticpro (&loadsearch_re_list); |
| 5755 | loadsearch_re_list = Qnil; | 5754 | loadsearch_re_list = Qnil; |
| 5756 | 5755 | ||
| 5757 | staticpro (&all_loaded_comp_units_h); | ||
| 5758 | all_loaded_comp_units_h = | ||
| 5759 | CALLN (Fmake_hash_table, QCweakness, Qkey_and_value, QCtest, Qequal); | ||
| 5760 | |||
| 5761 | DEFVAR_LISP ("comp-ctxt", Vcomp_ctxt, | 5756 | DEFVAR_LISP ("comp-ctxt", Vcomp_ctxt, |
| 5762 | doc: /* The compiler context. */); | 5757 | doc: /* The compiler context. */); |
| 5763 | Vcomp_ctxt = Qnil; | 5758 | Vcomp_ctxt = Qnil; |
| @@ -5817,6 +5812,12 @@ For internal use. */); | |||
| 5817 | doc: /* When non-nil assume the file being compiled to | 5812 | doc: /* When non-nil assume the file being compiled to |
| 5818 | be preloaded. */); | 5813 | be preloaded. */); |
| 5819 | 5814 | ||
| 5815 | DEFVAR_LISP ("comp-loaded-comp-units-h", Vcomp_loaded_comp_units_h, | ||
| 5816 | doc: /* Hash table recording all loaded compilation units. | ||
| 5817 | file -> CU. */); | ||
| 5818 | Vcomp_loaded_comp_units_h = | ||
| 5819 | CALLN (Fmake_hash_table, QCweakness, Qvalue, QCtest, Qequal); | ||
| 5820 | |||
| 5820 | Fprovide (intern_c_string ("native-compile"), Qnil); | 5821 | Fprovide (intern_c_string ("native-compile"), Qnil); |
| 5821 | #endif /* #ifdef HAVE_NATIVE_COMP */ | 5822 | #endif /* #ifdef HAVE_NATIVE_COMP */ |
| 5822 | 5823 | ||