From: Christophe Rhodes Date: Wed, 16 Jul 2003 08:25:59 +0000 (+0000) Subject: 0.8.1.34: X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=403bacffd903f8c5787a182f4133cffc69b55dc0;p=sbcl.git 0.8.1.34: Merge vector_nil_string_branch ... many other incremental fixes, including * decrease of number of places array properties need to be specified; * rework of build order so that unknown types are never specialized; * primitive types need to know the specifier, not the ctype, so make it so; * fixes to the kernel classoid hierarchy, so more likely to be consistent internally. The good news is that, should it prove necessary, reverting this patch so that (vector nil) isn't a string is probably not very much work; all that needs to be changed are the kernel classoid supertypes and the STRING and SIMPLE-STRING definitions (and unparses). On the other hand, I'd be interested in trying to fix any performance problem "the right way" before reverting this behaviour. --- 403bacffd903f8c5787a182f4133cffc69b55dc0 diff --cc package-data-list.lisp-expr index 2c8b88f,e5627f0..41f624c --- a/package-data-list.lisp-expr +++ b/package-data-list.lisp-expr @@@ -1301,7 -1298,9 +1304,8 @@@ is a good idea, but see SB-SYS re. blur "VALUES-TYPE-P" "VALUES-TYPE-REQUIRED" "VALUES-TYPE-REST" "VALUES-TYPE-UNION" "VALUES-TYPE-TYPES" "VALUES-TYPES" - "VALUES-TYPE-START" "VALUES-TYPES-EQUAL-OR-INTERSECT" "VECTOR-T-P" + "VECTOR-NIL-P" "VECTOR-TO-VECTOR*" "VECTOR-OF-CHECKED-LENGTH-GIVEN-LENGTH" "WITH-ARRAY-DATA" diff --cc src/code/deftypes-for-target.lisp index 44438c0,87f6d3e..0928858 --- a/src/code/deftypes-for-target.lisp +++ b/src/code/deftypes-for-target.lisp @@@ -104,20 -106,6 +106,12 @@@ ;;; semistandard types (sb!xc:deftype generalized-boolean () t) +(sb!xc:deftype format-control () + '(or string function)) + +(sb!xc:deftype restart-designator () + '(or (and symbol (not null)) restart)) + - ;;; a type specifier - ;;; - ;;; FIXME: The SB!KERNEL:INSTANCE here really means CL:CLASS. - ;;; However, the CL:CLASS type is only defined once PCL is loaded, - ;;; which is before this is evaluated. Once PCL is moved into cold - ;;; init, this might be fixable. - (sb!xc:deftype type-specifier () '(or list symbol sb!kernel:instance)) - ;;; array rank, total size... (sb!xc:deftype array-rank () `(integer 0 (,sb!xc:array-rank-limit))) (sb!xc:deftype array-total-size () diff --cc src/compiler/array-tran.lisp index 76e6f48,d425b36..b6b7c51 --- a/src/compiler/array-tran.lisp +++ b/src/compiler/array-tran.lisp @@@ -349,17 -268,11 +279,17 @@@ (len (if (constant-continuation-p length) (continuation-value length) '*)) - (result-type-spec `(simple-array ,eltype (,len))) (eltype-type (ir1-transform-specifier-type eltype)) + (result-type-spec + `(simple-array + ,(if (unknown-type-p eltype-type) + (give-up-ir1-transform + "ELEMENT-TYPE is an unknown type: ~S" eltype) + (sb!xc:upgraded-array-element-type eltype)) + (,len))) (saetp (find-if (lambda (saetp) - (csubtypep eltype-type (saetp-ctype saetp))) - *specialized-array-element-type-properties*))) + (csubtypep eltype-type (sb!vm:saetp-ctype saetp))) + sb!vm:*specialized-array-element-type-properties*))) (unless saetp (give-up-ir1-transform "cannot open-code creation of ~S" result-type-spec)) diff --cc src/compiler/generic/vm-tran.lisp index 634e687,3298c81..37fdb87 --- a/src/compiler/generic/vm-tran.lisp +++ b/src/compiler/generic/vm-tran.lisp @@@ -41,10 -41,18 +41,19 @@@ ;;;; simplifying HAIRY-DATA-VECTOR-REF and HAIRY-DATA-VECTOR-SET + (deftransform hairy-data-vector-ref ((string index) (simple-string t)) + (let ((ctype (continuation-type string))) + (if (array-type-p ctype) + ;; the other transform will kick in, so that's OK + (give-up-ir1-transform) + `(typecase string + ((simple-array character (*)) (data-vector-ref string index)) + ((simple-array nil (*)) (data-vector-ref string index)))))) + (deftransform hairy-data-vector-ref ((array index) (array t) * :important t) "avoid runtime dispatch on array element type" - (let ((element-ctype (extract-upgraded-element-type array))) + (let ((element-ctype (extract-upgraded-element-type array)) + (declared-element-ctype (extract-declared-element-type array))) (declare (type ctype element-ctype)) (when (eq *wild-type* element-ctype) (give-up-ir1-transform @@@ -80,6 -84,6 +89,18 @@@ (%array-data-vector array)) index))))) ++(deftransform hairy-data-vector-set ((string index new-value) ++ (simple-string t t)) ++ (let ((ctype (continuation-type string))) ++ (if (array-type-p ctype) ++ ;; the other transform will kick in, so that's OK ++ (give-up-ir1-transform) ++ `(typecase string ++ ((simple-array character (*)) ++ (data-vector-set string index new-value)) ++ ((simple-array nil (*)) ++ (data-vector-set string index new-value)))))) ++ (deftransform hairy-data-vector-set ((array index new-value) (array t t) * diff --cc version.lisp-expr index 4606f8f,5ca7467..4e2d67d --- a/version.lisp-expr +++ b/version.lisp-expr @@@ -17,4 -17,4 +17,4 @@@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) - "0.8.1.33" -"0.8.0.78.vector-nil-string.15" ++"0.8.1.34"