X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fpcl%2Ffngen.lisp;h=08d8bdd8bdf872f674061022918bbe8f2561f0a7;hb=d147d512602d761a2dcdfded506dd1a8f9a140dc;hp=4bd35caa910d03845a7cb34b22b5dfcb4759f116;hpb=e4eb979046e594444cf5972801ea5f4a5eb1a7c7;p=sbcl.git diff --git a/src/pcl/fngen.lisp b/src/pcl/fngen.lisp index 4bd35ca..08d8bdd 100644 --- a/src/pcl/fngen.lisp +++ b/src/pcl/fngen.lisp @@ -22,12 +22,9 @@ ;;;; specification. (in-package "SB-PCL") - -(sb-int:file-comment - "$Header$") ;;; GET-FUNCTION is the main user interface to this code. It is like -;;; COMPILE-LAMBDA, only more efficient. It achieves this efficiency by +;;; COMPILE, only more efficient. It achieves this efficiency by ;;; reducing the number of times that the compiler needs to be called. ;;; Calls to GET-FUNCTION in which the lambda forms differ only by constants ;;; can use the same piece of compiled code. (For example, dispatch dfuns and @@ -47,9 +44,6 @@ ;;; compute-constants is used to generate the argument list that is ;;; to be passed to the compiled function. ;;; -;;; Whether the returned function is actually compiled depends on whether -;;; the compiler is present (see COMPILE-LAMBDA) and whether this shape of -;;; code was precompiled. (defun get-function (lambda &optional (test-converter #'default-test-converter) (code-converter #'default-code-converter) @@ -124,7 +118,7 @@ (defun get-new-function-generator (lambda test code-converter) (multiple-value-bind (gensyms generator-lambda) (get-new-function-generator-internal lambda code-converter) - (let* ((generator (compile-lambda generator-lambda)) + (let* ((generator (compile nil generator-lambda)) (fgen (make-fgen test gensyms generator generator-lambda nil))) (store-fgen fgen) generator))) @@ -179,22 +173,19 @@ f))))))))) (defmacro precompile-function-generators (&optional system) - (let ((index -1)) - `(progn ,@(gathering1 (collecting) - (dolist (fgen *fgens*) - (when (or (null (fgen-system fgen)) - (eq (fgen-system fgen) system)) - (when system (setf (svref fgen 4) system)) - (gather1 - (make-top-level-form - `(precompile-function-generators ,system ,(incf index)) - '(:load-toplevel) - `(load-function-generator - ',(fgen-test fgen) - ',(fgen-gensyms fgen) - (function ,(fgen-generator-lambda fgen)) - ',(fgen-generator-lambda fgen) - ',system))))))))) + `(progn + ,@(gathering1 (collecting) + (dolist (fgen *fgens*) + (when (or (null (fgen-system fgen)) + (eq (fgen-system fgen) system)) + (when system (setf (svref fgen 4) system)) + (gather1 + `(load-function-generator + ',(fgen-test fgen) + ',(fgen-gensyms fgen) + (function ,(fgen-generator-lambda fgen)) + ',(fgen-generator-lambda fgen) + ',system))))))) (defun load-function-generator (test gensyms generator generator-lambda system) (store-fgen (make-fgen test gensyms generator generator-lambda system)))