X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fir2tran.lisp;h=e98d8390a8afd12f2eb22154eb958ae0eda926b2;hb=f22ad70037030c07074327cf239bd84dc17b44b6;hp=026b5098ff20995aa58f8a7a627513f34113edef;hpb=b9e94e326f79ab01e56cb437e424ce5ea489471f;p=sbcl.git diff --git a/src/compiler/ir2tran.lisp b/src/compiler/ir2tran.lisp index 026b509..e98d839 100644 --- a/src/compiler/ir2tran.lisp +++ b/src/compiler/ir2tran.lisp @@ -52,12 +52,16 @@ (emit-move-template node block (type-check-template type) value result) (values)) -;;; Allocate an indirect value cell. Maybe do some clever stack -;;; allocation someday. +;;; Allocate an indirect value cell. (defevent make-value-cell-event "Allocate heap value cell for lexical var.") (defun emit-make-value-cell (node block value res) (event make-value-cell-event node) - (vop make-value-cell node block value res)) + (let ((leaf (tn-leaf res))) + (vop make-value-cell node block value + (and leaf (leaf-dynamic-extent leaf) + ;; FIXME: See bug 419 + (policy node (> stack-allocate-value-cells 1))) + res))) ;;;; leaf reference @@ -131,13 +135,7 @@ (vop value-cell-ref node block tn res) (emit-move node block tn res)))) (constant - (if (legal-immediate-constant-p leaf) - (emit-move node block (constant-tn leaf) res) - (let* ((name (leaf-source-name leaf)) - (name-tn (emit-constant name))) - (if (policy node (zerop safety)) - (vop fast-symbol-value node block name-tn res) - (vop symbol-value node block name-tn res))))) + (emit-move node block (constant-tn leaf) res)) (functional (ir2-convert-closure node block leaf res)) (global-var @@ -302,7 +300,7 @@ (emit-move node block val tn))))) (global-var (ecase (global-var-kind leaf) - ((:special :global) + ((:special) (aver (symbolp (leaf-source-name leaf))) (vop set node block (emit-constant (leaf-source-name leaf)) val))))) (when locs @@ -1179,6 +1177,13 @@ (ir2-physenv-return-pc-pass env) (ir2-physenv-return-pc env)) + #!+unwind-to-frame-and-call-vop + (when (and (lambda-allow-instrumenting fun) + (not (lambda-inline-expanded fun)) + (lambda-return fun) + (policy fun (>= insert-debug-catch 2))) + (vop sb!vm::bind-sentinel node block)) + (let ((lab (gen-label))) (setf (ir2-physenv-environment-start env) lab) (vop note-environment-start node block lab))) @@ -1204,6 +1209,11 @@ (old-fp (ir2-physenv-old-fp env)) (return-pc (ir2-physenv-return-pc env)) (returns (tail-set-info (lambda-tail-set fun)))) + #!+unwind-to-frame-and-call-vop + (when (and (lambda-allow-instrumenting fun) + (not (lambda-inline-expanded fun)) + (policy fun (>= insert-debug-catch 2))) + (vop sb!vm::unbind-sentinel node block)) (cond ((and (eq (return-info-kind returns) :fixed) (not (xep-p fun))) @@ -1440,6 +1450,15 @@ (,bind ,vars ,vals)) nil ,@body) + ;; Technically ANSI CL doesn't allow declarations at the + ;; start of the cleanup form. SBCL happens to allow for + ;; them, due to the way the UNWIND-PROTECT ir1 translation + ;; is implemented; the cleanup forms are directly spliced + ;; into an FLET definition body. And a declaration here + ;; actually has exactly the right scope for what we need + ;; (ensure that debug instrumentation is not emitted for the + ;; cleanup function). -- JES, 2007-06-16 + (declare (optimize (insert-debug-catch 0))) (%primitive unbind-to-here ,n-save-bs)))))) ;;;; non-local exit