X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fpolicy.lisp;h=bef5b88cc17cc01ebef50745518b1d9f0e59fe2e;hb=2253ebaef8a0a1527d2282a1c10f48c62e0d4a83;hp=9ec12e3a9c4200c34e1aa32ac870819133c84dce;hpb=22b819c0cd0ca0ea5be52ba280b9e9e0b8e86210;p=sbcl.git diff --git a/src/compiler/policy.lisp b/src/compiler/policy.lisp index 9ec12e3..bef5b88 100644 --- a/src/compiler/policy.lisp +++ b/src/compiler/policy.lisp @@ -22,13 +22,6 @@ ;;; alists instead. (def!type policy () 'list) -;;; FIXME: the original implementation of this was protected by -;;; -;;; (eval-when (#-sb-xc-host :compile-toplevel :load-toplevel :execute) -;;; -;;; but I don't know why. This seems to work, but I don't understand -;;; why the original wasn't this in the first place. -- CSR, -;;; 2003-05-04 (defstruct policy-dependent-quality name expression @@ -37,8 +30,7 @@ ;;; names of recognized optimization policy qualities (defvar *policy-qualities*) ; (initialized at cold init) -(eval-when (:compile-toplevel :load-toplevel :execute) - (defvar *policy-dependent-qualities* nil)) ; alist of POLICY-DEPENDENT-QUALITYs +(defvar *policy-dependent-qualities* nil) ; alist of POLICY-DEPENDENT-QUALITYs ;;; Is X the name of an optimization policy quality? (defun policy-quality-name-p (x) @@ -75,10 +67,15 @@ inhibit-warnings)) (setf *policy* (mapcar (lambda (name) - ;; CMU CL didn't use 1 as the default for everything, - ;; but since ANSI says 1 is the ordinary value, we do. + ;; CMU CL didn't use 1 as the default for + ;; everything, but since ANSI says 1 is the ordinary + ;; value, we do. (cons name 1)) - *policy-qualities*))) + *policy-qualities*)) + ;; not actually POLICY, but very similar + (setf *handled-conditions* nil + *disabled-package-locks* nil)) + ;;; On the cross-compilation host, we initialize immediately (not ;;; waiting for "cold init", since cold init doesn't exist on ;;; cross-compilation host). @@ -88,6 +85,7 @@ ;;; called by compiler code for known-valid QUALITY-NAMEs, e.g. SPEED; ;;; it's an error if it's called for a quality which isn't defined. (defun policy-quality (policy quality-name) + (aver (policy-quality-name-p quality-name)) (let* ((acons (assoc quality-name policy)) (result (or (cdr acons) 1))) result)) @@ -127,5 +125,6 @@ :values-documentation ',documentation))) (if acons (setf (cdr acons) item) - (push `(,',name . ,item) *policy-dependent-qualities*))) + (setf *policy-dependent-qualities* + (nconc *policy-dependent-qualities* (list `(,',name . ,item)))))) ',name))