0.pre7.141:
[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-LOWTAG are defined. Remove the :SUFFIXes and just expand
18 ;;; out the full names. Or even define them in DEF EVEN-FIXNUM-LOWTAG
19 ;;; style so searches like 'def.*even-fixnum-lowtag' can find them.
20
21 ;;; tags for the main low-level types, to be stored in the low three
22 ;;; bits to identify the type of a machine word 
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-LOWTAG, which is
26   ;; defined in the first DEFENUM. -- AL 20000216
27   (defenum (:suffix -lowtag)
28     even-fixnum
29     ;; Note: CMU CL, and SBCL < 0.pre7.39, had FUN-POINTER-LOWTAG
30     ;; here. We swapped FUN-POINTER-LOWTAG and
31     ;; INSTANCE-POINTER-LOWTAG 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     fun-pointer
39     other-immediate-1
40     other-pointer))
41
42 ;;; the heap types, stored in 8 bits of the header of an object on the
43 ;;; heap, to identify the type of the heap object (which'll be at
44 ;;; least two machine words, often more)
45 (defenum (:suffix -widetag
46           :start (+ (ash 1 n-lowtag-bits) other-immediate-0-lowtag)
47           :step (ash 1 (1- n-lowtag-bits)))
48   bignum
49   ratio
50   single-float
51   double-float
52   #!+long-float long-float
53   complex
54   complex-single-float
55   complex-double-float
56   #!+long-float complex-long-float
57
58   simple-array
59   simple-string
60   simple-bit-vector
61   simple-vector
62   simple-array-unsigned-byte-2
63   simple-array-unsigned-byte-4
64   simple-array-unsigned-byte-8
65   simple-array-unsigned-byte-16
66   simple-array-unsigned-byte-32
67   simple-array-signed-byte-8
68   simple-array-signed-byte-16
69   simple-array-signed-byte-30
70   simple-array-signed-byte-32
71   simple-array-single-float
72   simple-array-double-float
73   #!+long-float simple-array-long-float
74   simple-array-complex-single-float
75   simple-array-complex-double-float
76   #!+long-float simple-array-complex-long-float
77   complex-string
78   complex-bit-vector
79   complex-vector
80   complex-array
81
82   code-header
83   simple-fun-header
84   closure-header
85   funcallable-instance-header
86   closure-fun-header
87
88   return-pc-header
89   value-cell-header
90   symbol-header
91   base-char
92   sap
93   unbound-marker
94   weak-pointer
95   instance-header
96   fdefn)
97
98 ;;; the different vector subtypes
99 (defenum (:prefix vector- :suffix -subtype)
100   normal
101   unused
102   valid-hashing
103   must-rehash)