From 1dd2c8cd0770040b616803f4b6a4a81ff314ea6a Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Sun, 28 Jun 2020 20:38:13 +0100 Subject: [PATCH] * Enable deferred compilation for dynamic scoped code * src/comp.c (maybe_defer_native_compilation): Trigger for dynamic code and add a comment. --- src/comp.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/comp.c b/src/comp.c index 3abcabc8933..28f10bed6d1 100644 --- a/src/comp.c +++ b/src/comp.c @@ -4411,6 +4411,14 @@ dispose_comp_unit (struct Lisp_Native_Comp_Unit *comp_handle, bool delay) loaded the compiler and its dependencies. */ static Lisp_Object delayed_sources; + +/* Queue an asyncronous compilation for the source file defining + FUNCTION_NAME and perform a late load. + + NOTE: ideally would be nice to move its call simply into Fload but + we need DEFINITION to guard against function redefinition while + async compilation happen. */ + void maybe_defer_native_compilation (Lisp_Object function_name, Lisp_Object definition) @@ -4443,7 +4451,6 @@ maybe_defer_native_compilation (Lisp_Object function_name, || noninteractive || !NILP (Vpurify_flag) || !COMPILEDP (definition) - || !FIXNUMP (AREF (definition, COMPILED_ARGLIST)) || !STRINGP (Vload_true_file_name) || !suffix_p (Vload_true_file_name, ".elc")) return; -- 2.39.5