diff options
author | William Harold Newman <william.newman@airmail.net> | 2001-12-06 17:15:02 +0000 |
---|---|---|
committer | William Harold Newman <william.newman@airmail.net> | 2001-12-06 17:15:02 +0000 |
commit | 863d1c0c3314d9002e511e9f98c00d9f0f9bfa78 (patch) | |
tree | 4af026eb8f06ff04fbe4f59042bb022ba020b48b /src/compiler/dfo.lisp | |
parent | ba7659c92f2b7fac7e9532a3db9114c5bdc4ab55 (diff) |
0.pre7.86.flaky7.24:
I've come to suspect that the debugger/restart/QUIT problem
has to do with the same closure/component bug I
fixed above, except for closures over NLXs instead
of over LAMBDA-VARs. So I'd like to generalize the
LAMBDA-REFERS-TO-VARS fix to deal with NLXs as well.
In preparation for that...
...merged LAMBDA-REFERS-TO-VARS and LAMBDA-CALLS into
LAMBDA-CALLS-OR-CLOSES
Diffstat (limited to 'src/compiler/dfo.lisp')
-rw-r--r-- | src/compiler/dfo.lisp | 46 |
1 files changed, 25 insertions, 21 deletions
diff --git a/src/compiler/dfo.lisp b/src/compiler/dfo.lisp index 68469c8f2..a135cd575 100644 --- a/src/compiler/dfo.lisp +++ b/src/compiler/dfo.lisp @@ -255,27 +255,31 @@ (unlink-blocks return-block (component-tail old-lambda-component)))) (let ((res (find-initial-dfo-aux bind-block component))) (declare (type component res)) - ;; Scavenge call relationships. - (let ((calls (if (eq (lambda-kind clambda) :external) - (append (find-reference-funs clambda) - (lambda-calls clambda)) - (lambda-calls clambda)))) - (dolist (call calls) - (let ((call-home (lambda-home call))) - (setf res (dfo-scavenge-dependency-graph call-home res))))) - ;; Scavenge closure-over relationships: if FUN refers to a - ;; variable whose home lambda is not FUN, then the home lambda - ;; should be in the same component as FUN. (sbcl-0.6.13, and - ;; CMU CL, didn't do this, leading to the occasional failure - ;; when physenv analysis, which is local to each component, - ;; would bogusly conclude that a closed-over variable was - ;; unused and thus delete it. See e.g. cmucl-imp 2001-11-29.) - (dolist (var (lambda-refers-to-vars clambda)) - (unless (null (lambda-var-refs var)) ; i.e. unless deleted - (let ((var-home-home (lambda-home (lambda-var-home var)))) - (unless (eql (lambda-kind var-home-home) :deleted) - (setf res - (dfo-scavenge-dependency-graph var-home-home res)))))) + ;; Scavenge related lambdas. + (flet (;; Scavenge call relationship. + (scavenge-call (call) + (let ((call-home (lambda-home call))) + (setf res (dfo-scavenge-dependency-graph call-home res)))) + ;; Scavenge closure-over relationship: if FUN refers to a + ;; variable whose home lambda is not FUN, then the home lambda + ;; should be in the same component as FUN. (sbcl-0.6.13, and + ;; CMU CL, didn't do this, leading to the occasional failure + ;; when physenv analysis, which is local to each component, + ;; would bogusly conclude that a closed-over variable was + ;; unused and thus delete it. See e.g. cmucl-imp 2001-11-29.) + (scavenge-closure-var (var) + (unless (null (lambda-var-refs var)) ; i.e. unless deleted + (let ((var-home-home (lambda-home (lambda-var-home var)))) + (unless (eql (lambda-kind var-home-home) :deleted) + (setf res + (dfo-scavenge-dependency-graph var-home-home + res))))))) + (dolist (cc (lambda-calls-or-closes clambda)) + (etypecase cc + (clambda (scavenge-call cc)) + (lambda-var (scavenge-closure-var cc)))) + (when (eq (lambda-kind clambda) :external) + (mapc #'scavenge-call (find-reference-funs clambda)))) ;; Voila. res))))) |