diff options
| author | Andrea Corallo | 2020-05-02 17:29:11 +0100 |
|---|---|---|
| committer | Andrea Corallo | 2020-05-15 20:06:49 +0100 |
| commit | 44b0ce6e38f06df10b60ffdd9d9ade4b7e229088 (patch) | |
| tree | 6747059990968a57a6c7c75b7da1e1cd5f9ae287 /src/comp.h | |
| parent | 49f0331f53fb9eaa2039538a983eb7b6dbcd206f (diff) | |
| download | emacs-44b0ce6e38f06df10b60ffdd9d9ade4b7e229088.tar.gz emacs-44b0ce6e38f06df10b60ffdd9d9ade4b7e229088.zip | |
Add anonymous lambdas reload mechanism
* src/pdumper.c (dump_do_dump_relocation): Initialize
'lambda_gc_guard' while resurrecting.
(dump_do_dump_relocation): Revive lambdas and fixup them.
* src/comp.h (struct Lisp_Native_Comp_Unit): Define new
'lambda_gc_guard' 'lambda_c_name_idx_h' 'data_imp_relocs'
'loaded_once' fields.
* src/comp.c (load_comp_unit): Use compilaiton unit 'loaded_once'
field.
(make_subr, Fcomp__register_lambda): New functions.
(Fcomp__register_subr): Make use of 'make_subr'.
(Fnative_elisp_load): Indent.
(Fnative_elisp_load): Initialize 'lambda_gc_guard'
'lambda_c_name_idx_h' fields.
(syms_of_comp): Add Scomp__register_lambda.
* lisp/emacs-lisp/comp.el (comp-ctxt): Change
'byte-func-to-func-h' hash key test.
(comp-ctxt): Add 'lambda-fixups-h' slot.
(comp-emit-lambda-for-top-level): New function.
(comp-finalize-relocs): Never emit lambdas in pure space.
(comp-finalize-relocs): Fixup relocation indexes.
Diffstat (limited to 'src/comp.h')
| -rw-r--r-- | src/comp.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/comp.h b/src/comp.h index cbdcaccd5fe..b03a8055142 100644 --- a/src/comp.h +++ b/src/comp.h | |||
| @@ -37,13 +37,21 @@ struct Lisp_Native_Comp_Unit | |||
| 37 | /* Original eln file loaded. */ | 37 | /* Original eln file loaded. */ |
| 38 | Lisp_Object file; | 38 | Lisp_Object file; |
| 39 | Lisp_Object optimize_qualities; | 39 | Lisp_Object optimize_qualities; |
| 40 | /* Hash doc-idx -> function documentaiton. */ | 40 | /* Guard anonymous lambdas against Garbage Collection and make them |
| 41 | dumpable. */ | ||
| 42 | Lisp_Object lambda_gc_guard; | ||
| 43 | /* Hash c_name -> d_reloc_imp index. */ | ||
| 44 | Lisp_Object lambda_c_name_idx_h; | ||
| 45 | /* Hash doc-idx -> function documentaiton. */ | ||
| 41 | Lisp_Object data_fdoc_v; | 46 | Lisp_Object data_fdoc_v; |
| 42 | /* Analogous to the constant vector but per compilation unit. */ | 47 | /* Analogous to the constant vector but per compilation unit. */ |
| 43 | Lisp_Object data_vec; | 48 | Lisp_Object data_vec; |
| 44 | /* Same but for data that cannot be moved to pure space. | 49 | /* 'data_impure_vec' must be last (see allocate_native_comp_unit). |
| 45 | Must be the last lisp object here. */ | 50 | Same as data_vec but for data that cannot be moved to pure space. */ |
| 46 | Lisp_Object data_impure_vec; | 51 | Lisp_Object data_impure_vec; |
| 52 | /* STUFFS WE DO NOT DUMP!! */ | ||
| 53 | Lisp_Object *data_imp_relocs; | ||
| 54 | bool loaded_once; | ||
| 47 | dynlib_handle_ptr handle; | 55 | dynlib_handle_ptr handle; |
| 48 | }; | 56 | }; |
| 49 | 57 | ||