b49671fbbce5e138a0df21633b6b5ab0c18300be
[sbcl.git] / src / compiler / generic / parms.lisp
1 ;;;; This file contains some parameterizations of various VM
2 ;;;; attributes common to all architectures.
3
4 ;;;; This software is part of the SBCL system. See the README file for
5 ;;;; more information.
6 ;;;;
7 ;;;; This software is derived from the CMU CL system, which was
8 ;;;; written at Carnegie Mellon University and released into the
9 ;;;; public domain. The software is in the public domain and is
10 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
11 ;;;; files for more information.
12
13 (in-package "SB!VM")
14
15 (def!macro !configure-dynamic-space-end (&optional default)
16   (with-open-file (f "output/dynamic-space-size.txt")
17     (let ((line (read-line f)))
18       (multiple-value-bind (number end)
19           (parse-integer line :junk-allowed t)
20         (if number
21             (let* ((ext (subseq line end))
22                    (mult (cond ((or (zerop (length ext))
23                                     (member ext '("MB MIB") :test #'equalp))
24                                 (expt 2 20))
25                                ((member ext '("GB" "GIB") :test #'equalp)
26                                 (expt 2 30))
27                                (t
28                                 (error "Invalid --dynamic-space-size=~A" line)))))
29               `(+ dynamic-space-start ,(* number mult)))
30             (or default
31                 `(+ dynamic-space-start
32                     (ecase n-word-bits
33                       (32 (expt 2 29))
34                       (64 (expt 2 30))))))))))
35
36 (defparameter *c-callable-static-symbols*
37   '(sub-gc
38     sb!kernel::post-gc
39     sb!kernel::internal-error
40     sb!kernel::control-stack-exhausted-error
41     sb!kernel::binding-stack-exhausted-error
42     sb!kernel::alien-stack-exhausted-error
43     sb!kernel::heap-exhausted-error
44     sb!kernel::undefined-alien-variable-error
45     sb!kernel::undefined-alien-function-error
46     sb!kernel::memory-fault-error
47     sb!kernel::unhandled-trap-error
48     sb!di::handle-breakpoint
49     sb!di::handle-single-step-trap
50     fdefinition-object
51     #!+win32 sb!kernel::handle-win32-exception
52     #!+sb-thruption sb!thread::run-interruption))
53
54 (defparameter *common-static-symbols*
55   '(t
56
57     ;; filled in by the C code to propagate to Lisp
58     *posix-argv* *core-string*
59
60     ;; free pointers.  Note that these are FIXNUM word counts, not (as
61     ;; one might expect) byte counts or SAPs. The reason seems to be
62     ;; that by representing them this way, we can avoid consing
63     ;; bignums.  -- WHN 2000-10-02
64     *read-only-space-free-pointer*
65     *static-space-free-pointer*
66
67     ;; things needed for non-local-exit
68     *current-catch-block*
69     *current-unwind-protect-block*
70
71     #!+hpux *c-lra*
72
73     ;; stack pointers
74     *binding-stack-start*
75     *control-stack-start*
76     *control-stack-end*
77
78     ;; interrupt handling
79     *alloc-signal*
80     *free-interrupt-context-index*
81     sb!unix::*allow-with-interrupts*
82     sb!unix::*interrupts-enabled*
83     sb!unix::*interrupt-pending*
84     #!+sb-thruption sb!unix::*thruption-pending*
85     #!+sb-thruption sb!impl::*restart-clusters*
86     *in-without-gcing*
87     *gc-inhibit*
88     *gc-pending*
89     #!-sb-thread
90     *stepping*
91     #!+sb-safepoint sb!impl::*gc-safe*
92     #!+sb-safepoint sb!impl::*in-safepoint*
93
94     ;; threading support
95     #!+sb-thread *stop-for-gc-pending*
96     #!+sb-thread *free-tls-index*
97     #!+sb-thread *tls-index-lock*
98
99     ;; Dispatch tables for generic array access
100     sb!impl::%%data-vector-reffers%%
101     sb!impl::%%data-vector-reffers/check-bounds%%
102     sb!impl::%%data-vector-setters%%
103     sb!impl::%%data-vector-setters/check-bounds%%
104
105     ;; non-x86oid gencgc object pinning
106     #!+(and gencgc (not (or x86 x86-64)))
107     *pinned-objects*
108
109     ;; hash table weaknesses
110     :key
111     :value
112     :key-and-value
113     :key-or-value))
114
115 ;;; Number of entries in the thread local storage. Limits the number
116 ;;; of symbols with thread local bindings.
117 (def!constant tls-size 4096)
118
119 #!+gencgc
120 (progn
121   (def!constant +highest-normal-generation+ 5)
122   (def!constant +pseudo-static-generation+ 6))
123
124 (defenum ()
125   trace-table-normal
126   trace-table-call-site
127   trace-table-fun-prologue
128   trace-table-fun-epilogue)