Allocate symbols into permgen if enabled
[sbcl.git] / src / code / describe-policy.lisp
blobbd627e42c506e285e95763066126d95bdc1ecbaa
1 ;;;; DESCRIBE-COMPILER-POLICY
3 ;;;; This software is part of the SBCL system. See the README file for
4 ;;;; more information.
5 ;;;;
6 ;;;; This software is derived from the CMU CL system, which was
7 ;;;; written at Carnegie Mellon University and released into the
8 ;;;; public domain. The software is in the public domain and is
9 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
10 ;;;; files for more information.
12 (in-package "SB-C")
14 (defun describe-compiler-policy (&optional spec)
15 "Print all global optimization settings, augmented by SPEC."
16 (let ((policy (process-optimize-decl (cons 'optimize spec) *policy*)))
17 (fresh-line)
18 (format t " Basic qualities:~%")
19 (dovector (quality +policy-primary-qualities+)
20 (format t "~S = ~D~%" quality (policy-quality policy quality)))
21 (format t " Dependent qualities:~%")
22 (loop for info across **policy-dependent-qualities**
23 for quality = (policy-dependent-quality-name info)
24 for values-documentation = (policy-dependent-quality-values-documentation info)
25 for explicit-value = (policy-quality policy quality)
26 do (if (= explicit-value 1)
27 (let* ((getter (policy-dependent-quality-getter info))
28 (value (funcall getter policy))
29 (documentation (elt values-documentation value)))
30 (format t "~S = ~D -> ~D (~A)~%"
31 quality explicit-value value documentation))
32 (let ((documentation (elt values-documentation explicit-value)))
33 (format t "~S = ~D (~A)~%"
34 quality explicit-value documentation)))))
36 (values))