diff options
Diffstat (limited to 'src/comp.c')
| -rw-r--r-- | src/comp.c | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/src/comp.c b/src/comp.c index b9ecef07f32..74b74a83b77 100644 --- a/src/comp.c +++ b/src/comp.c | |||
| @@ -492,7 +492,7 @@ declare_imported_func (Lisp_Object subr_sym, gcc_jit_type *ret_type, | |||
| 492 | 492 | ||
| 493 | /* String containing the function ptr name. */ | 493 | /* String containing the function ptr name. */ |
| 494 | Lisp_Object f_ptr_name = | 494 | Lisp_Object f_ptr_name = |
| 495 | CALLN (Ffuncall, intern_c_string (STR (comp-c-func-name)), | 495 | CALLN (Ffuncall, intern_c_string ("comp-c-func-name"), |
| 496 | subr_sym, make_string ("R", 1)); | 496 | subr_sym, make_string ("R", 1)); |
| 497 | 497 | ||
| 498 | gcc_jit_type *f_ptr_type = | 498 | gcc_jit_type *f_ptr_type = |
| @@ -3360,6 +3360,40 @@ helper_PSEUDOVECTOR_TYPEP_XUNTAG (Lisp_Object a, enum pvec_type code) | |||
| 3360 | } | 3360 | } |
| 3361 | 3361 | ||
| 3362 | 3362 | ||
| 3363 | /***********************************/ | ||
| 3364 | /* Deferred compilation mechanism. */ | ||
| 3365 | /***********************************/ | ||
| 3366 | |||
| 3367 | void | ||
| 3368 | maybe_defer_native_compilation (Lisp_Object function_name, | ||
| 3369 | Lisp_Object definition) | ||
| 3370 | { | ||
| 3371 | Lisp_Object src = Qnil; | ||
| 3372 | Lisp_Object load_list = Vcurrent_load_list; | ||
| 3373 | |||
| 3374 | FOR_EACH_TAIL (load_list) | ||
| 3375 | { | ||
| 3376 | src = XCAR (load_list); | ||
| 3377 | if (!CONSP (src)) | ||
| 3378 | break; | ||
| 3379 | } | ||
| 3380 | |||
| 3381 | if (!comp_deferred_compilation | ||
| 3382 | || noninteractive | ||
| 3383 | || !NILP (Vpurify_flag) | ||
| 3384 | || !COMPILEDP (definition) | ||
| 3385 | || !FIXNUMP (AREF (definition, COMPILED_ARGLIST)) | ||
| 3386 | || !STRINGP (src) | ||
| 3387 | || !suffix_p (src, ".elc")) | ||
| 3388 | return; | ||
| 3389 | |||
| 3390 | src = concat2 (CALL1I (file-name-sans-extension, src), | ||
| 3391 | build_pure_c_string (".el")); | ||
| 3392 | if (!NILP (Ffile_exists_p (src))) | ||
| 3393 | CALLN (Ffuncall, intern_c_string ("native-compile-async"), src, Qnil); | ||
| 3394 | } | ||
| 3395 | |||
| 3396 | |||
| 3363 | /**************************************/ | 3397 | /**************************************/ |
| 3364 | /* Functions used to load eln files. */ | 3398 | /* Functions used to load eln files. */ |
| 3365 | /**************************************/ | 3399 | /**************************************/ |
| @@ -3552,6 +3586,8 @@ void | |||
| 3552 | syms_of_comp (void) | 3586 | syms_of_comp (void) |
| 3553 | { | 3587 | { |
| 3554 | /* Compiler control customizes. */ | 3588 | /* Compiler control customizes. */ |
| 3589 | DEFVAR_BOOL ("comp-deferred-compilation", comp_deferred_compilation, | ||
| 3590 | doc: /* If t compile asyncronously every .elc file loaded. */); | ||
| 3555 | DEFSYM (Qcomp_speed, "comp-speed"); | 3591 | DEFSYM (Qcomp_speed, "comp-speed"); |
| 3556 | DEFSYM (Qcomp_debug, "comp-debug"); | 3592 | DEFSYM (Qcomp_debug, "comp-debug"); |
| 3557 | 3593 | ||