4d793bef9cedfdfbab5be9a63b4229219bff6467
[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
53 (defparameter *common-static-symbols*
54   '(t
55
56     ;; filled in by the C code to propagate to Lisp
57     *posix-argv* *core-string*
58
59     ;; free pointers.  Note that these are FIXNUM word counts, not (as
60     ;; one might expect) byte counts or SAPs. The reason seems to be
61     ;; that by representing them this way, we can avoid consing
62     ;; bignums.  -- WHN 2000-10-02
63     *read-only-space-free-pointer*
64     *static-space-free-pointer*
65
66     ;; things needed for non-local-exit
67     *current-catch-block*
68     *current-unwind-protect-block*
69
70     #!+hpux *c-lra*
71
72     ;; stack pointers
73     *binding-stack-start*
74     *control-stack-start*
75     *control-stack-end*
76
77     ;; interrupt handling
78     *alloc-signal*
79     *free-interrupt-context-index*
80     sb!unix::*allow-with-interrupts*
81     sb!unix::*interrupts-enabled*
82     sb!unix::*interrupt-pending*
83     *in-without-gcing*
84     *gc-inhibit*
85     *gc-pending*
86     #!-sb-thread
87     *stepping*
88
89     ;; threading support
90     #!+sb-thread *stop-for-gc-pending*
91     #!+sb-thread *free-tls-index*
92     #!+sb-thread *tls-index-lock*
93
94     ;; Dispatch tables for generic array access
95     sb!impl::%%data-vector-reffers%%
96     sb!impl::%%data-vector-reffers/check-bounds%%
97     sb!impl::%%data-vector-setters%%
98     sb!impl::%%data-vector-setters/check-bounds%%
99
100     ;; non-x86oid gencgc object pinning
101     #!+(and gencgc (not (or x86 x86-64)))
102     *pinned-objects*
103
104     ;; hash table weaknesses
105     :key
106     :value
107     :key-and-value
108     :key-or-value))
109
110 ;;; Number of entries in the thread local storage. Limits the number
111 ;;; of symbols with thread local bindings.
112 (def!constant tls-size 4096)
113
114 #!+gencgc
115 (progn
116   (def!constant +highest-normal-generation+ 5)
117   (def!constant +pseudo-static-generation+ 6))
118
119 (defenum ()
120   trace-table-normal
121   trace-table-call-site
122   trace-table-fun-prologue
123   trace-table-fun-epilogue)