0.8.1.34:
authorChristophe Rhodes <csr21@cam.ac.uk>
Wed, 16 Jul 2003 08:25:59 +0000 (08:25 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Wed, 16 Jul 2003 08:25:59 +0000 (08:25 +0000)
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.

15 files changed:
1  2 
build-order.lisp-expr
package-data-list.lisp-expr
src/code/array.lisp
src/code/deftypes-for-target.lisp
src/code/early-extensions.lisp
src/code/late-type.lisp
src/code/seq.lisp
src/code/stream.lisp
src/code/string.lisp
src/compiler/array-tran.lisp
src/compiler/fndb.lisp
src/compiler/generic/vm-tran.lisp
src/compiler/generic/vm-type.lisp
src/compiler/knownfun.lisp
version.lisp-expr

Simple merge
@@@ -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"
Simple merge
  ;;; 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 ()
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
         (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))
Simple merge
  \f
  ;;;; 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
                                       (%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)
                                     *
Simple merge
Simple merge
@@@ -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"