Revert "Clean up %more-arg-values."
[sbcl.git] / src / compiler / x86 / values.lisp
index c7c294b..082ad2c 100644 (file)
 ;;; defining a new stack frame.
 (define-vop (%more-arg-values)
   (:args (context :scs (descriptor-reg any-reg) :target src)
+         (skip :scs (any-reg immediate))
          (num :scs (any-reg) :target count))
-  (:arg-types * positive-fixnum)
+  (:arg-types * positive-fixnum positive-fixnum)
   (:temporary (:sc any-reg :offset esi-offset :from (:argument 0)) src)
   (:temporary (:sc descriptor-reg :offset eax-offset) temp)
   (:temporary (:sc unsigned-reg :offset ecx-offset) loop-index)
   (:results (start :scs (any-reg))
             (count :scs (any-reg)))
   (:generator 20
-    (move src context)
-    (move count num)
+    (sc-case skip
+      (immediate
+       (cond ((zerop (tn-value skip))
+              (move src context)
+              (move count num))
+             (t
+              (inst lea src (make-ea :dword :base context
+                                     :disp (- (* (tn-value skip)
+                                                 n-word-bytes))))
+              (move count num)
+              (inst sub count (* (tn-value skip) n-word-bytes)))))
+
+      (any-reg
+       (move src context)
+       (inst sub src skip)
+       (move count num)
+       (inst sub count skip)))
 
     (move loop-index count)
     (inst mov start esp-tn)
     (inst mov (make-ea :dword :base esp-tn :index loop-index) temp)
     (inst jmp :nz LOOP)
 
-    DONE))
+    DONE
+    ))