;;; others (toplevel form time instead of cold load init time) because
;;; ALIEN-VALUE itself is a structure which isn't defined until fairly
;;; late.
-;;;
-;;; FIXME: I'm somewhat tempted to just punt ALIEN from the type system.
-;;; It's sufficiently unlike the others that it's a bit of a pain, and
-;;; it doesn't seem to be put to any good use either in type inference or
-;;; in type declarations.
(!define-superclasses alien ((alien-value)) progn)
(!define-type-method (alien :simple-=) (type1 type2)
;;; type is going to be the array upgraded element type.
(defun extract-upgraded-element-type (array)
(let ((type (continuation-type array)))
+ ;; Note that this IF mightn't be satisfied even if the runtime
+ ;; value is known to be a subtype of some specialized ARRAY, because
+ ;; we can have values declared e.g. (AND SIMPLE-VECTOR UNKNOWN-TYPE),
+ ;; which are represented in the compiler as INTERSECTION-TYPE, not
+ ;; array type.
(if (array-type-p type)
(array-type-specialized-element-type type)
*universal-type*)))
(defun assert-new-value-type (new-value array)
(let ((type (continuation-type array)))
(when (array-type-p type)
- (assert-continuation-type new-value (array-type-specialized-element-type type))))
+ (assert-continuation-type new-value
+ (array-type-specialized-element-type type))))
(continuation-type new-value))
-;;; Return true if Arg is NIL, or is a constant-continuation whose
+;;; Return true if ARG is NIL, or is a constant-continuation whose
;;; value is NIL, false otherwise.
(defun unsupplied-or-nil (arg)
(declare (type (or continuation null) arg))
(simple-array t)
*
:important t)
- (let* ((atype (continuation-type array))
- (eltype (array-type-specialized-element-type atype)))
- (when (eq eltype *wild-type*)
- (give-up-ir1-transform
- "specialized array element type not known at compile-time"))
- `(if (array-header-p array)
- (values (%array-data-vector array) index)
- (values array index))))
+
+ ;; We do this solely for the -OR-GIVE-UP side effect, since we want
+ ;; to know that the type can be figured out in the end before we
+ ;; proceed, but we don't care yet what the type will turn out to be.
+ (upgraded-element-type-specifier-or-give-up array)
+
+ '(if (array-header-p array)
+ (values (%array-data-vector array) index)
+ (values array index)))
;;; transforms for getting at simple arrays of (UNSIGNED-BYTE N) when (< N 8)
;;;
*universal-type*)))))
(defoptimizer (array-element-type derive-type) ((array))
- (let* ((array-type (continuation-type array)))
+ (let ((array-type (continuation-type array)))
(labels ((consify (list)
(if (endp list)
'(eql nil)
(defun floating-point-pain (x)
(declare (single-float x))
(log x))
+
+;;; bug found and fixed ca. sbcl-0.7.5.12: The INTERSECTION-TYPE
+;;; here satisfies "is a subtype of ARRAY-TYPE", but can't be
+;;; accessed with ARRAY-TYPE accessors like
+;;; ARRAY-TYPE-SPECIALIZED-ELEMENT-TYPE, so ARRAY-related
+;;; DEFTRANSFORMs died with TYPE-ERROR at compile time when
+;;; compiling the DEFUN here.
+(defun stupid-input-to-smart-array-deftransforms-0-7-5-12 (v)
+ (declare (type (and simple-vector fwd-type-ref) v))
+ (aref v 0))
\f
;;;; tests not in the problem domain, but of the consistency of the
;;;; compiler machinery itself
;;; for internal versions, especially for internal versions off the
;;; main CVS branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.7.5.14"
+"0.7.5.15"