X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Ftypedefs.lisp;h=23179304d5bd9a472fefd64d5c4231fadd35c109;hb=10adbe19b88bf9d4fe65ad67f6de0fd065af87ff;hp=228d6053529798665c5389050c9097e413008565;hpb=67d2b80e478824a46317419f076ab1f6b020f6b1;p=sbcl.git diff --git a/src/code/typedefs.lisp b/src/code/typedefs.lisp index 228d605..2317930 100644 --- a/src/code/typedefs.lisp +++ b/src/code/typedefs.lisp @@ -43,7 +43,8 @@ (if (eq '&whole (car arglist)) (values (cadr arglist) (cddr arglist)) (values (gensym) arglist)) - (multiple-value-bind (forms decls) (parse-body body nil) + (multiple-value-bind (forms decls) + (parse-body body :doc-string-allowed nil) `(progn (!cold-init-forms (setf (info :type :translator ',name) @@ -76,7 +77,7 @@ (enumerable nil :read-only t) ;; an arbitrary hash code used in EQ-style hashing of identity ;; (since EQ hashing can't be done portably) - (hash-value (random (1+ most-positive-fixnum)) + (hash-value (random #.(ash 1 20)) :type (and fixnum unsigned-byte) :read-only t) ;; Can this object contain other types? A global property of our @@ -88,7 +89,7 @@ ;; is disjoint from MEMBER-TYPE and so forth. But types which can ;; contain other types, like HAIRY-TYPE and INTERSECTION-TYPE, can ;; violate this rule. - (might-contain-other-types? nil :read-only t)) + (might-contain-other-types-p nil :read-only t)) (def!method print-object ((ctype ctype) stream) (print-unreadable-object (ctype stream :type t) (prin1 (type-specifier ctype) stream))) @@ -128,6 +129,15 @@ (logand (logxor (ash (type-hash-value type1) -3) (type-hash-value type2)) #xFF)) +#!-sb-fluid (declaim (inline type-list-cache-hash)) +(declaim (ftype (function (list) (unsigned-byte 8)) type-list-cache-hash)) +(defun type-list-cache-hash (types) + (logand (loop with res = 0 + for type in types + for hash = (type-hash-value type) + do (setq res (logxor res hash)) + finally (return res)) + #xFF)) ;;;; cold loading initializations