0.pre7.20:
[sbcl.git] / src / compiler / generic / early-objdef.lisp
1 ;;;; type-based constants
2
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.
11
12 (in-package "SB!VM")
13
14 ;;; FIXME: It's clever using :SUFFIX -TYPE for these things, but it's
15 ;;; a pain for people just learning to find their way around the code
16 ;;; who want to use lexical search to figure out where things like
17 ;;; EVEN-FIXNUM type are defined. Remove the :SUFFIXes and just expand
18 ;;; out the full names. Or even define them in DEF-FROB EVEN-FIXNUM-TYPE
19 ;;; style so searches like 'def.*even-fixnum-type' can find them.
20
21 ;;; the main types. These types are represented by the low three bits
22 ;;; of the pointer or immediate object.
23 (eval-when (:compile-toplevel :load-toplevel :execute)
24   ;; The EVAL-WHEN is necessary (at least for Lispworks), because the
25   ;; second DEFENUM uses the value of OTHER-IMMEDIATE-0-TYPE, which is
26   ;; defined in the first DEFENUM. -- AL 20000216
27   (defenum (:suffix -type)
28     even-fixnum
29     function-pointer
30     other-immediate-0
31     list-pointer
32     odd-fixnum
33     instance-pointer
34     other-immediate-1
35     other-pointer))
36
37 ;;; the heap types. Each of these types is in the header of objects in
38 ;;; the heap.
39 (defenum (:suffix -type
40           :start (+ (ash 1 lowtag-bits) other-immediate-0-type)
41           :step (ash 1 (1- lowtag-bits)))
42   bignum
43   ratio
44   single-float
45   double-float
46   #!+long-float long-float
47   complex
48   complex-single-float
49   complex-double-float
50   #!+long-float complex-long-float
51
52   simple-array
53   simple-string
54   simple-bit-vector
55   simple-vector
56   simple-array-unsigned-byte-2
57   simple-array-unsigned-byte-4
58   simple-array-unsigned-byte-8
59   simple-array-unsigned-byte-16
60   simple-array-unsigned-byte-32
61   simple-array-signed-byte-8
62   simple-array-signed-byte-16
63   simple-array-signed-byte-30
64   simple-array-signed-byte-32
65   simple-array-single-float
66   simple-array-double-float
67   #!+long-float simple-array-long-float
68   simple-array-complex-single-float
69   simple-array-complex-double-float
70   #!+long-float simple-array-complex-long-float
71   complex-string
72   complex-bit-vector
73   complex-vector
74   complex-array
75
76   code-header
77   function-header
78   closure-header
79   funcallable-instance-header
80   byte-code-function
81   byte-code-closure
82   closure-function-header
83   #!-gengc return-pc-header
84   #!+gengc forwarding-pointer
85   value-cell-header
86   symbol-header
87   base-char
88   sap
89   unbound-marker
90   weak-pointer
91   instance-header
92   fdefn
93   )
94
95 ;;; the different vector subtypes
96 (defenum (:prefix vector- :suffix -subtype)
97   normal
98   unused
99   valid-hashing
100   must-rehash)