diff --git a/src/cmp/cmpeval.lsp b/src/cmp/cmpeval.lsp index 6a86b939c..90c48163f 100644 --- a/src/cmp/cmpeval.lsp +++ b/src/cmp/cmpeval.lsp @@ -82,8 +82,10 @@ (when fun (when (> (length args) si::c-arguments-limit) (return-from c1call-local (unoptimized-long-call `#',fname args))) + (let ((lambda (fun-lambda-expression fun))) + (when (and lambda (inline-possible fname)) + (return-from c1call-local (c1expr `(funcall #',lambda ,@args))))) (let* ((forms (c1args* args)) - (lambda-form (fun-lambda fun)) (return-type (or (get-local-return-type fun) 'T)) (arg-types (get-local-arg-types fun))) ;; Add type information to the arguments. diff --git a/src/cmp/cmplam.lsp b/src/cmp/cmplam.lsp index 4a9935ab3..645b6751f 100644 --- a/src/cmp/cmplam.lsp +++ b/src/cmp/cmplam.lsp @@ -77,8 +77,12 @@ The function thus belongs to the type of functions that ecl_make_cfun accepts." (defun c1compile-function (lambda-list-and-body &key (fun (make-fun)) (name (fun-name fun)) (CB/LB 'CB)) - (setf (fun-name fun) name - (fun-parent fun) *current-function*) + (let ((lambda (if name + `(ext:lambda-block ,name ,@lambda-list-and-body) + `(lambda ,@lambda-list-and-body)))) + (setf (fun-name fun) name + (fun-lambda-expression fun) lambda + (fun-parent fun) *current-function*)) (when *current-function* (push fun (fun-child-funs *current-function*))) (let* ((*current-function* fun) diff --git a/src/cmp/cmptypes.lsp b/src/cmp/cmptypes.lsp index 66995ace3..4ee1cf7e5 100644 --- a/src/cmp/cmptypes.lsp +++ b/src/cmp/cmptypes.lsp @@ -149,6 +149,7 @@ lambda-list ;;; List of (requireds optionals rest-var keywords-p ;;; keywords allow-other-keys-p) lambda ;;; Lambda c1-form for this function. + lambda-expression ;;; LAMBDA or LAMBDA-BLOCK expression (minarg 0) ;;; Min. number arguments that the function receives. (maxarg call-arguments-limit) ;;; Max. number arguments that the function receives.