X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Ftarget-type.lisp;h=0c254486a4f15e9e5c08ebe9bcd9feb61e30be14;hb=74a48d09e08aead6f67204878bdf9be4f448e1e8;hp=871cb84eb07de09894f52a11beb47e40af40a6a7;hpb=a40c4adfd7837230109cdb1f054b44fe0b15371a;p=sbcl.git diff --git a/src/code/target-type.lisp b/src/code/target-type.lisp index 871cb84..0c25448 100644 --- a/src/code/target-type.lisp +++ b/src/code/target-type.lisp @@ -13,17 +13,6 @@ (!begin-collecting-cold-init-forms) -;;; Just call %TYPEP. -;;; -;;; Note that when cross-compiling, SB!XC:TYPEP is interpreted as -;;; a test that the host Lisp object OBJECT translates to a target SBCL -;;; type TYPE. (This behavior is needed e.g. to test for the validity of -;;; numeric subtype bounds read when cross-compiling.) -(defun typep (object type) - #!+sb-doc - "Return T iff OBJECT is of type TYPE." - (%typep object type)) - ;;; If TYPE is a type that we can do a compile-time test on, then ;;; return whether the object is of that type as the first value and ;;; second value true. Otherwise return NIL, NIL. @@ -63,7 +52,7 @@ #'ctypep obj (compound-type-types type))) - (function-type + (fun-type (values (functionp obj) t)) (unknown-type (values nil nil)) @@ -117,7 +106,7 @@ ;; time), we need to suppress a DEFTRANSFORM.. -- WHN 19991004 (declare (notinline sb!xc:find-class)) (class-layout (sb!xc:find-class 'null)))) - (t (svref *built-in-class-codes* (get-type x))))) + (t (svref *built-in-class-codes* (widetag-of x))))) #!-sb-fluid (declaim (inline sb!xc:class-of)) (defun sb!xc:class-of (object) @@ -127,12 +116,8 @@ (layout-class (layout-of object))) ;;; Pull the type specifier out of a function object. -(defun extract-function-type (fun) - (typecase fun - (byte-function (byte-function-type fun)) - (byte-closure (byte-function-type (byte-closure-function fun))) - (t - (specifier-type (%function-type (%closure-function fun)))))) +(defun extract-fun-type (fun) + (specifier-type (%simple-fun-type (%closure-fun fun)))) ;;;; miscellaneous interfaces @@ -164,7 +149,7 @@ (function (if (funcallable-instance-p x) (sb!xc:class-of x) - (extract-function-type x))) + (extract-fun-type x))) (symbol (make-member-type :members (list x))) (number