Initial revision
[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 (file-comment
15   "$Header$")
16
17 ;;; FIXME: It's clever using :SUFFIX -TYPE for these things, but it's
18 ;;; a pain for people just learning to find their way around the code
19 ;;; who want to figure out where things like EVEN-FIXNUM type are
20 ;;; defined. Remove the :SUFFIXes and just expand out the full names.
21
22 ;;; the main types. These types are represented by the low three bits of the
23 ;;; pointer or immeditate object.
24 (defenum (:suffix -type)
25   even-fixnum
26   function-pointer
27   other-immediate-0
28   list-pointer
29   odd-fixnum
30   instance-pointer
31   other-immediate-1
32   other-pointer)
33
34 ;;; the heap types. Each of these types is in the header of objects in
35 ;;; the heap.
36 (defenum (:suffix -type
37           :start (+ (ash 1 lowtag-bits) other-immediate-0-type)
38           :step (ash 1 (1- lowtag-bits)))
39   bignum
40   ratio
41   single-float
42   double-float
43   #!+long-float long-float
44   complex
45   complex-single-float
46   complex-double-float
47   #!+long-float complex-long-float
48
49   simple-array
50   simple-string
51   simple-bit-vector
52   simple-vector
53   simple-array-unsigned-byte-2
54   simple-array-unsigned-byte-4
55   simple-array-unsigned-byte-8
56   simple-array-unsigned-byte-16
57   simple-array-unsigned-byte-32
58   simple-array-signed-byte-8
59   simple-array-signed-byte-16
60   simple-array-signed-byte-30
61   simple-array-signed-byte-32
62   simple-array-single-float
63   simple-array-double-float
64   #!+long-float simple-array-long-float
65   simple-array-complex-single-float
66   simple-array-complex-double-float
67   #!+long-float simple-array-complex-long-float
68   complex-string
69   complex-bit-vector
70   complex-vector
71   complex-array
72
73   code-header
74   function-header
75   closure-header
76   funcallable-instance-header
77   byte-code-function
78   byte-code-closure
79   closure-function-header
80   #!-gengc return-pc-header
81   #!+gengc forwarding-pointer
82   value-cell-header
83   symbol-header
84   base-char
85   sap
86   unbound-marker
87   weak-pointer
88   instance-header
89   fdefn
90   )
91
92 ;;; the different vector subtypes
93 (defenum (:prefix vector- :suffix -subtype)
94   normal
95   unused
96   valid-hashing
97   must-rehash)