0.pre7.39:
[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     ;; Note: CMU CL, and SBCL < 0.pre7.39, had FUNCTION-POINTER-TYPE
30     ;; here. We swapped FUNCTION-POINTER-TYPE and
31     ;; INSTANCE-POINTER-TYPE in sbcl-0.pre7.39 in order to help with a
32     ;; low-level pun in the function call sequence on the PPC port.
33     ;; For more information, see the PPC port code. -- WHN 2001-10-03
34     instance-pointer
35     other-immediate-0
36     list-pointer
37     odd-fixnum
38     function-pointer
39     other-immediate-1
40     other-pointer))
41
42 ;;; the heap types. Each of these types is in the header of objects in
43 ;;; the heap.
44 (defenum (:suffix -type
45           :start (+ (ash 1 lowtag-bits) other-immediate-0-type)
46           :step (ash 1 (1- lowtag-bits)))
47   bignum
48   ratio
49   single-float
50   double-float
51   #!+long-float long-float
52   complex
53   complex-single-float
54   complex-double-float
55   #!+long-float complex-long-float
56
57   simple-array
58   simple-string
59   simple-bit-vector
60   simple-vector
61   simple-array-unsigned-byte-2
62   simple-array-unsigned-byte-4
63   simple-array-unsigned-byte-8
64   simple-array-unsigned-byte-16
65   simple-array-unsigned-byte-32
66   simple-array-signed-byte-8
67   simple-array-signed-byte-16
68   simple-array-signed-byte-30
69   simple-array-signed-byte-32
70   simple-array-single-float
71   simple-array-double-float
72   #!+long-float simple-array-long-float
73   simple-array-complex-single-float
74   simple-array-complex-double-float
75   #!+long-float simple-array-complex-long-float
76   complex-string
77   complex-bit-vector
78   complex-vector
79   complex-array
80
81   code-header
82   function-header
83   closure-header
84   funcallable-instance-header
85   byte-code-function
86   byte-code-closure
87   closure-function-header
88   #!-gengc return-pc-header
89   #!+gengc forwarding-pointer
90   value-cell-header
91   symbol-header
92   base-char
93   sap
94   unbound-marker
95   weak-pointer
96   instance-header
97   fdefn
98   )
99
100 ;;; the different vector subtypes
101 (defenum (:prefix vector- :suffix -subtype)
102   normal
103   unused
104   valid-hashing
105   must-rehash)