X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcode%2Fbyte-interp.lisp;h=a890b0ada0126d8f522cce1347f8b94209312d9c;hb=2c6b90e36a7c0377cd79625eb6c94d580f98cb93;hp=9dc34ea0b23ec9f6879f46b41e69559175d4232e;hpb=6f408b4ce6a2f411618fe1bebf63ee08093a7d03;p=sbcl.git diff --git a/src/code/byte-interp.lisp b/src/code/byte-interp.lisp index 9dc34ea..a890b0a 100644 --- a/src/code/byte-interp.lisp +++ b/src/code/byte-interp.lisp @@ -2,9 +2,6 @@ (in-package "SB!C") -(file-comment - "$Header$") - ;;;; This software is part of the SBCL system. See the README file for ;;;; more information. ;;;; @@ -30,19 +27,19 @@ (etypecase x (simple-byte-function `(function ,(make-list (simple-byte-function-num-args x) - :initial-element 't) + :initial-element t) *)) (hairy-byte-function (collect ((res)) (let ((min (hairy-byte-function-min-args x)) (max (hairy-byte-function-max-args x))) - (dotimes (i min) (res 't)) + (dotimes (i min) (res t)) (when (> max min) (res '&optional) (dotimes (i (- max min)) - (res 't)))) + (res t)))) (when (hairy-byte-function-rest-arg-p x) - (res '&rest 't)) + (res '&rest t)) (ecase (hairy-byte-function-keywords-p x) ((t :allow-others) (res '&key) @@ -280,7 +277,7 @@ ;;; FIXME: This doesn't seem to be needed in the target Lisp, only ;;; at build-the-system time. ;;; -;;; KLUDGE: This expands into code a la +;;; KLUDGE: This expands into code like ;;; (IF (ZEROP (LOGAND BYTE 16)) ;;; (IF (ZEROP (LOGAND BYTE 8)) ;;; (IF (ZEROP (LOGAND BYTE 4)) @@ -302,9 +299,8 @@ ;;; implement suitable code as jump tables. (defmacro expand-into-inlines () #+nil (declare (optimize (inhibit-warnings 3))) - (iterate build-dispatch - ((bit 4) - (base 0)) + (named-let build-dispatch ((bit 4) + (base 0)) (if (minusp bit) (let ((info (svref *inline-functions* base))) (if info @@ -386,12 +382,6 @@ (defun %byte-special-unbind () (sb!sys:%primitive unbind) (values)) - -;;; obsolete... -#!-sb-fluid (declaim (inline cons-unique-tag)) -(defun cons-unique-tag () - (list '#:%unique-tag%)) -;;; FIXME: Delete this once the system is working. ;;;; two-arg function stubs ;;;; @@ -506,7 +496,7 @@ (closure-vars (make-array num-closure-vars))) (declare (type index num-closure-vars) (type simple-vector closure-vars)) - (iterate frob ((index (1- num-closure-vars))) + (named-let frob ((index (1- num-closure-vars))) (unless (minusp index) (setf (svref closure-vars index) (pop-eval-stack)) (frob (1- index)))) @@ -995,7 +985,7 @@ (type stack-pointer old-sp old-fp) (type (or null simple-vector) closure-vars)) (when closure-vars - (iterate more ((index (1- (length closure-vars)))) + (named-let more ((index (1- (length closure-vars)))) (unless (minusp index) (push-eval-stack (svref closure-vars index)) (more (1- index))))) @@ -1016,7 +1006,7 @@ ;;; Call a function with some arguments popped off of the interpreter ;;; stack, and restore the SP to the specifier value. (defun byte-apply (function num-args restore-sp) - (declare (function function) (type index num-args)) + (declare (type function function) (type index num-args)) (let ((start (- (current-stack-pointer) num-args))) (declare (type stack-pointer start)) (macrolet ((frob () @@ -1208,19 +1198,20 @@ (type stack-pointer more-args-start)) (cond ((not (hairy-byte-function-keywords-p xep)) - (assert restp) + (aver restp) (setf (current-stack-pointer) (1+ more-args-start)) (setf (eval-stack-ref more-args-start) rest)) (t (unless (evenp more-args-supplied) (with-debugger-info (old-component ret-pc old-fp) - (error "odd number of keyword arguments"))) - ;; If there are keyword args, then we need to leave the - ;; defaulted and supplied-p values where the more args - ;; currently are. There might be more or fewer. And also, - ;; we need to flatten the parsed args with the defaults - ;; before we scan the keywords. So we copy all the more - ;; args to a temporary area at the end of the stack. + (error "odd number of &KEY arguments"))) + ;; If there are &KEY args, then we need to leave + ;; the defaulted and supplied-p values where the + ;; more args currently are. There might be more or + ;; fewer. And also, we need to flatten the parsed + ;; args with the defaults before we scan the + ;; keywords. So we copy all the more args to a + ;; temporary area at the end of the stack. (let* ((num-more-args (hairy-byte-function-num-more-args xep)) (new-sp (+ more-args-start num-more-args))