X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fgtn.lisp;h=ca2c23f65b782e93935ae42fc278ac8901002cda;hb=f741a144c386acdb82cac2e3352abab7cff65f1d;hp=1a22dd005c955597f9e1f13582fa62987fb1542f;hpb=d604a358d8e5eb5587989e0a4f1d31dbe6ac5ffe;p=sbcl.git diff --git a/src/compiler/gtn.lisp b/src/compiler/gtn.lisp index 1a22dd0..ca2c23f 100644 --- a/src/compiler/gtn.lisp +++ b/src/compiler/gtn.lisp @@ -43,13 +43,24 @@ (let* ((type (if (lambda-var-indirect var) *backend-t-primitive-type* (primitive-type (leaf-type var)))) - (temp (make-normal-tn type)) + (res (make-normal-tn type)) (node (lambda-bind fun)) - (res (if (or (and let-p (policy node (< debug 3))) - (policy node (zerop debug)) - (policy node (= speed 3))) - temp - (physenv-debug-live-tn temp (lambda-physenv fun))))) + (debug-variable-p (not (or (and let-p (policy node (< debug 3))) + (policy node (zerop debug)) + (policy node (= speed 3)))))) + (cond + ((and (lambda-var-indirect var) + (not (lambda-var-explicit-value-cell var))) + ;; Force closed-over indirect LAMBDA-VARs without explicit + ;; VALUE-CELLs to the stack, and make sure that they are + ;; live over the dynamic contour of the physenv. + (setf (tn-sc res) (svref *backend-sc-numbers* + sb!vm:control-stack-sc-number)) + (physenv-live-tn res (lambda-physenv fun))) + + (debug-variable-p + (physenv-debug-live-tn res (lambda-physenv fun)))) + (setf (tn-leaf res) var) (setf (leaf-info var) res)))) (values)) @@ -108,11 +119,14 @@ ;;; -- It appears to be more efficient to use the standard convention, ;;; since there are no non-TR local calls that could benefit from ;;; a non-standard convention. +;;; -- We're compiling with RETURN-FROM-FRAME instrumentation, which +;;; only works (on x86 and x86-64) for the standard convention. (defun use-standard-returns (tails) (declare (type tail-set tails)) (let ((funs (tail-set-funs tails))) (or (and (find-if #'xep-p funs) (find-if #'has-full-call-use funs)) + (some (lambda (fun) (policy fun (>= insert-debug-catch 2))) funs) (block punt (dolist (fun funs t) (dolist (ref (leaf-refs fun))