Skip to content
Snippets Groups Projects
Commit 48d1f01f authored by Raymond Toy's avatar Raymond Toy
Browse files

Fix #24: compile already compiled function

If the function is already compiled and we don't have the source for
it any more, just return without recompiling anything.
parent f810fc97
No related branches found
No related tags found
No related merge requests found
...@@ -2045,7 +2045,7 @@ ...@@ -2045,7 +2045,7 @@
(function-lambda-expression definition) (function-lambda-expression definition)
(if (and exp (not lexenv)) (if (and exp (not lexenv))
`#',exp `#',exp
`',definition))))) definition)))))
(*source-info* (make-lisp-source-info form)) (*source-info* (make-lisp-source-info form))
(*top-level-lambdas* ()) (*top-level-lambdas* ())
(*converting-for-interpreter* nil) (*converting-for-interpreter* nil)
...@@ -2069,6 +2069,14 @@ ...@@ -2069,6 +2069,14 @@
(*gensym-counter* 0) (*gensym-counter* 0)
(*current-function-names* (list name)) (*current-function-names* (list name))
(intl::*default-domain* intl::*default-domain*)) (intl::*default-domain* intl::*default-domain*))
;; As mentioned above, we can return the same function if the
;; function was already compiled. We do this when FORM is EQ
;; to DEFINITION (which happens above if we have a compiled
;; function that we don't have the source for or was defined
;; in a non-null environment.
(when (and name (eq form definition))
(return-from compile
(values name nil nil)))
(with-debug-counters (with-debug-counters
(clear-stuff) (clear-stuff)
(find-source-paths form 0) (find-source-paths form 0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment