X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Ftypep.lisp;h=43acfdfdb561b0d6a83105885897ecf2b9f4e4de;hb=007bcd5aac2f3a1e714563bd39f7a2db2d0bf7c2;hp=ca3c349108e1ab98978d637cf01cc86d692f9109;hpb=8aa1742a4cf5fb4752148ace41a779482b195bd4;p=sbcl.git diff --git a/src/code/typep.lisp b/src/code/typep.lisp index ca3c349..43acfdf 100644 --- a/src/code/typep.lisp +++ b/src/code/typep.lisp @@ -39,6 +39,7 @@ ((* t) t) ((instance) (%instancep object)) ((funcallable-instance) (funcallable-instance-p object)) + ((extended-sequence) (extended-sequence-p object)) ((nil) nil))) (numeric-type (and (numberp object) @@ -104,7 +105,8 @@ (specifier-type (array-element-type object))))))) (member-type - (if (member object (member-type-members type)) t)) + (when (member-type-member-p object type) + t)) (classoid #+sb-xc-host (ctypep object type) #-sb-xc-host (classoid-typep (layout-of object) type object)) @@ -176,6 +178,14 @@ ;;; Test whether OBJ-LAYOUT is from an instance of CLASSOID. (defun classoid-typep (obj-layout classoid object) (declare (optimize speed)) + ;; FIXME & KLUDGE: We could like to grab the *WORLD-LOCK* here (to ensure that + ;; class graph doesn't change while we're doing the typep test), but in + ;; pratice that causes trouble -- deadlocking against the compiler + ;; if compiler output (or macro, or compiler-macro expansion) causes + ;; another thread to do stuff. Not locking is a shoddy bandaid as it is remains + ;; easy to trigger the same problem using a different code path -- but in practice + ;; locking here makes Slime unusable with :SPAWN in post *WORLD-LOCK* world. So... + ;; -- NS 2008-12-16 (multiple-value-bind (obj-layout layout) (do ((layout (classoid-layout classoid) (classoid-layout classoid)) (i 0 (+ i 1)) @@ -186,7 +196,7 @@ (aver (< i 2)) (when (layout-invalid obj-layout) (setq obj-layout (update-object-layout-or-invalid object layout))) - (ensure-classoid-valid classoid layout)) + (%ensure-classoid-valid classoid layout)) (let ((obj-inherits (layout-inherits obj-layout))) (or (eq obj-layout layout) (dotimes (i (length obj-inherits) nil)