Speed up PSXHASH on complex numbers.
[sbcl.git] / src / code / primordial-type.lisp
blobbb6a127f3bcfdcc27aa0ff8309b2ed83a68b442e
1 ;;;; This software is part of the SBCL system. See the README file for
2 ;;;; more information.
3 ;;;;
4 ;;;; This software is derived from the CMU CL system, which was
5 ;;;; written at Carnegie Mellon University and released into the
6 ;;;; public domain. The software is in the public domain and is
7 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
8 ;;;; files for more information.
10 (in-package "SB!KERNEL")
12 (!begin-collecting-cold-init-forms)
14 (!define-type-class named :enumerable nil :might-contain-other-types nil)
16 (macrolet ((frob (type global-sym)
17 `(progn
18 #+sb-xc-host
19 (progn (defvar ,global-sym
20 (mark-ctype-interned (make-named-type :name ',type)))
21 ;; Make it known as a constant in the cross-compiler.
22 (setf (info :variable :kind ',global-sym) :constant))
23 (!cold-init-forms
24 #+sb-xc (sb!c::%defconstant ',global-sym ,global-sym
25 (sb!c::source-location))
26 (setf (info :type :builtin ',type) ,global-sym
27 (info :type :kind ',type) :primitive)))))
28 ;; KLUDGE: In ANSI, * isn't really the name of a type, it's just a
29 ;; special symbol which can be stuck in some places where an
30 ;; ordinary type can go, e.g. (ARRAY * 1) instead of (ARRAY T 1).
31 ;; In SBCL it also used to denote universal VALUES type.
32 (frob * *wild-type*)
33 (frob nil *empty-type*)
34 (frob t *universal-type*)
35 ;; new in sbcl-0.9.5: these used to be CLASSOID types, but that
36 ;; view of them was incompatible with requirements on the MOP
37 ;; metaobject class hierarchy: the INSTANCE and
38 ;; FUNCALLABLE-INSTANCE types are disjoint (instances have
39 ;; instance-pointer-lowtag; funcallable-instances have
40 ;; fun-pointer-lowtag), while FUNCALLABLE-STANDARD-OBJECT is
41 ;; required to be a subclass of STANDARD-OBJECT. -- CSR,
42 ;; 2005-09-09
43 (frob instance *instance-type*)
44 (frob funcallable-instance *funcallable-instance-type*)
45 ;; new in sbcl-1.0.3.3: necessary to act as a join point for the
46 ;; extended sequence hierarchy. (Might be removed later if we use
47 ;; a dedicated FUNDAMENTAL-SEQUENCE class for this.)
48 (frob extended-sequence *extended-sequence-type*))
50 ;;; a vector that maps type codes to layouts, used for quickly finding
51 ;;; the layouts of built-in classes
52 (defglobal **built-in-class-codes** #()) ; initialized in cold load
53 (declaim (type simple-vector **built-in-class-codes**))
55 (!defun-from-collected-cold-init-forms !primordial-type-cold-init)