0.8.10.3:
[sbcl.git] / src / compiler / ir2tran.lisp
index 1941881..7c4e321 100644 (file)
 (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
 ;;;      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)
 (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))))
 \f
 ;;;; 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)))
     (vop reset-stack-pointer node block
         (first (ir2-lvar-locs 2lvar)))))
 
+(defoptimizer (%nip-values ir2-convert) ((last-nipped last-preserved &rest moved)
+                                         node block)
+  #!-x86
+  (bug "%NIP-VALUES is not implemented on this platform.")
+  #!+x86
+  (let ((2after (lvar-info (lvar-value last-nipped)))
+                                        ; pointer immediately after the nipped block
+        (2first (lvar-info (lvar-value last-preserved)))
+                                        ; pointer to the first nipped word
+        (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)
 (defoptimizer (%special-unbind ir2-convert) ((var) node block)
   (vop unbind node block))
 
+(defoptimizer (%dynamic-extent-start ir2-convert) (() node block) node block)
+(defoptimizer (%dynamic-extent-end ir2-convert) (() node block) node block)
+
 ;;; ### It's not clear that this really belongs in this file, or
 ;;; should really be done this way, but this is the least violation of
 ;;; abstraction in the current setup. We don't want to wire
                (ir2-convert-ref node 2block)))))
        (combination
         (let ((kind (basic-combination-kind node)))
-          (case kind
+          (ecase kind
             (:local
              (ir2-convert-local-call node 2block))
             (:full
              (ir2-convert-full-call node 2block))
-            (t
-             (let ((fun (fun-info-ir2-convert kind)))
+            (:known
+             (let* ((info (basic-combination-fun-info node))
+                    (fun (fun-info-ir2-convert info)))
                (cond (fun
                       (funcall fun node 2block))
                      ((eq (basic-combination-info node) :full)