Skip to content
Snippets Groups Projects
Commit 8523478a authored by ram's avatar ram
Browse files

Prevent recursive opportunistic inline expansion during IR1 conversion by

temporarily clearing the DEFINED-FUNCTION-INLINE-EXPANSION when doing the
conversion.
parent 09646329
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu. ;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;; ;;;
(ext:file-comment (ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/ir1tran.lisp,v 1.81 1992/09/29 16:46:46 ram Exp $") "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/ir1tran.lisp,v 1.82 1992/12/08 17:59:14 ram Exp $")
;;; ;;;
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
...@@ -3402,29 +3402,36 @@ ...@@ -3402,29 +3402,36 @@
;;; converting a DEFUN. This is used both by the %DEFUN translator and for ;;; converting a DEFUN. This is used both by the %DEFUN translator and for
;;; global inline expansion. ;;; global inline expansion.
;;; ;;;
;;; Unless a :INLINE function, we temporarily clobber the inline expansion.
;;; This prevents recursive inline expansion of opportunistic pseudo-inlines.
;;;
(defun ir1-convert-lambda-for-defun (defun ir1-convert-lambda-for-defun
(lambda var expansion converter parent-form) (lambda var expansion converter parent-form)
(declare (cons lambda) (function converter) (type defined-function var)) (declare (cons lambda) (function converter) (type defined-function var))
(let* ((name (leaf-name var)) (let ((var-expansion (defined-function-inline-expansion var)))
(fun (funcall converter lambda name parent-form)) (unless (eq (defined-function-inlinep var) :inline)
(function-info (info function info name))) (setf (defined-function-inline-expansion var) nil))
(setf (functional-inlinep fun) (defined-function-inlinep var)) (let* ((name (leaf-name var))
(assert-new-definition var fun) (fun (funcall converter lambda name parent-form))
;; (function-info (info function info name)))
;; If definitely not an interpreter stub, then substitute for any (setf (functional-inlinep fun) (defined-function-inlinep var))
;; old references. (assert-new-definition var fun)
(unless (or (eq (defined-function-inlinep var) :notinline) (setf (defined-function-inline-expansion var) var-expansion)
(not *block-compile*)
(and function-info
(or (function-info-transforms function-info)
(function-info-templates function-info)
(function-info-ir2-convert function-info))))
(substitute-leaf fun var)
;; ;;
;; If in a simple environment, then we can allow backward references ;; If definitely not an interpreter stub, then substitute for any
;; to this function from following top-level forms. ;; old references.
(when expansion (setf (defined-function-functional var) fun))) (unless (or (eq (defined-function-inlinep var) :notinline)
fun)) (not *block-compile*)
(and function-info
(or (function-info-transforms function-info)
(function-info-templates function-info)
(function-info-ir2-convert function-info))))
(substitute-leaf fun var)
;;
;; If in a simple environment, then we can allow backward references
;; to this function from following top-level forms.
(when expansion (setf (defined-function-functional var) fun)))
fun)))
;;; %DEFUN IR1 convert -- Internal ;;; %DEFUN IR1 convert -- Internal
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment