X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcompiler%2Fir2tran.lisp;h=cf611d432588a580149a170ec8502f5a80eefca0;hb=e0697854ef9f4999c8585b64be1b282ce4725176;hp=f54563cf66cf956553ed23bb14311986999c97d6;hpb=5ef7f500a505f5711b1c76ff8c15f443d4815367;p=sbcl.git diff --git a/src/compiler/ir2tran.lisp b/src/compiler/ir2tran.lisp index f54563c..cf611d4 100644 --- a/src/compiler/ir2tran.lisp +++ b/src/compiler/ir2tran.lisp @@ -559,6 +559,7 @@ (defun find-template-result-types (call template rtypes) (declare (type combination call) (type template template) (list rtypes)) + (declare (ignore template)) (let* ((dtype (node-derived-type call)) (type dtype) (types (mapcar #'primitive-type @@ -857,6 +858,7 @@ ;;; lvar LOC. ;;; -- We don't know what it is. (defun fun-lvar-tn (node block lvar) + (declare (ignore node block)) (declare (type lvar lvar)) (let ((2lvar (lvar-info lvar))) (if (eq (ir2-lvar-kind 2lvar) :delayed) @@ -1208,16 +1210,16 @@ (defoptimizer (sb!kernel:%caller-frame-and-pc ir2-convert) (() node block) (let ((ir2-physenv (physenv-info (node-physenv node)))) (move-lvar-result node block - (list (ir2-physenv-old-fp ir2-physenv) - (ir2-physenv-return-pc ir2-physenv)) - (node-lvar node)))) + (list (ir2-physenv-old-fp ir2-physenv) + (ir2-physenv-return-pc ir2-physenv)) + (node-lvar node)))) ;;;; multiple values ;;; This is almost identical to IR2-CONVERT-LET. Since LTN annotates -;;; the lvarinuation for the correct number of values (with the lvar -;;; user responsible for defaulting), we can just pick them up from -;;; the lvar. +;;; the lvar for the correct number of values (with the lvar user +;;; responsible for defaulting), we can just pick them up from the +;;; lvar. (defun ir2-convert-mv-bind (node block) (declare (type mv-combination node) (type ir2-block block)) (let* ((lvar (first (basic-combination-args node))) @@ -1280,6 +1282,27 @@ (vop reset-stack-pointer node block (first (ir2-lvar-locs 2lvar))))) +(defoptimizer (%nip-values ir2-convert) ((last-nipped last-preserved + &rest moved) + node block) + (let (;; pointer immediately after the nipped block + (2after (lvar-info (lvar-value last-nipped))) + ;; pointer to the first nipped word + (2first (lvar-info (lvar-value last-preserved))) + + (moved-tns (loop for lvar-ref in moved + for lvar = (lvar-value lvar-ref) + for 2lvar = (lvar-info lvar) + ;when 2lvar + collect (first (ir2-lvar-locs 2lvar))))) + (aver (eq (ir2-lvar-kind 2after) :unknown)) + (aver (eq (ir2-lvar-kind 2first) :unknown)) + (vop* %%nip-values node block + ((first (ir2-lvar-locs 2after)) + (first (ir2-lvar-locs 2first)) + (reference-tn-list moved-tns nil)) + ((reference-tn-list moved-tns t))))) + ;;; Deliver the values TNs to LVAR using MOVE-LVAR-RESULT. (defoptimizer (values ir2-convert) ((&rest values) node block) (let ((tns (mapcar (lambda (x)