Changeset 11262


Ignore:
Timestamp:
Oct 30, 2008, 2:59:48 PM (11 years ago)
Author:
gz
Message:

In aref optimizer, don't assume all subtypes of 'array are ctype-array's, handle union types and ignore anything else

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/working-0711/ccl/compiler/optimizers.lisp

    r11089 r11262  
    18671867  (let* ((ctype (if (nx-form-typep a 'array env)
    18681868                  (specifier-type (nx-form-type a env) env)))
    1869          (type (if ctype (type-specifier (array-ctype-specialized-element-type ctype))))
    1870          (useful (unless (or (eq type *) (eq type t))
    1871                    type)))
     1869         (ectype (typecase ctype
     1870                   (array-ctype (array-ctype-specialized-element-type ctype))
     1871                   (union-ctype (when (every #'array-ctype-p (union-ctype-types ctype))
     1872                                  (%type-union
     1873                                   (mapcar (lambda (ct) (array-ctype-specialized-element-type ct))
     1874                                           (union-ctype-types ctype)))))))
     1875         (etype (and ectype (type-specifier ectype)))
     1876         (useful (unless (or (eq etype *) (eq etype t))
     1877                   etype)))
    18721878    (if (= 2 (length subscripts))
    18731879      (setq call `(%aref2 ,a ,@subscripts))
Note: See TracChangeset for help on using the changeset viewer.