/[cmucl]/src/compiler/array-tran.lisp
ViewVC logotype

Diff of /src/compiler/array-tran.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.14 by ram, Tue Nov 12 14:14:14 1991 UTC revision 1.15 by ram, Tue May 11 13:49:57 1993 UTC
# Line 157  Line 157 
157  ;;; Convert VECTOR into a make-array followed by setfs of all the elements.  ;;; Convert VECTOR into a make-array followed by setfs of all the elements.
158  ;;;  ;;;
159  (def-source-transform vector (&rest elements)  (def-source-transform vector (&rest elements)
160    (let ((len (length elements))    (if *byte-compiling*
161          (n -1))        (values nil t)
162      (once-only ((n-vec `(make-array ,len)))        (let ((len (length elements))
163        `(progn              (n -1))
164           ,@(mapcar #'(lambda (el)          (once-only ((n-vec `(make-array ,len)))
165                         (once-only ((n-val el))            `(progn
166                           `(locally (declare (optimize (safety 0)))               ,@(mapcar #'(lambda (el)
167                              (setf (svref ,n-vec ,(incf n)) ,n-val))))                             (once-only ((n-val el))
168                     elements)                               `(locally (declare (optimize (safety 0)))
169           ,n-vec))))                                         (setf (svref ,n-vec ,(incf n))
170                                                 ,n-val))))
171                           elements)
172                 ,n-vec)))))
173    
174    
175  ;;; MAKE-STRING  --  source-transform.  ;;; MAKE-STRING  --  source-transform.
# Line 174  Line 177 
177  ;;; Just convert it into a make-array.  ;;; Just convert it into a make-array.
178  ;;;  ;;;
179  (def-source-transform make-string (length &key (initial-element #\NULL))  (def-source-transform make-string (length &key (initial-element #\NULL))
180    `(make-array (the index ,length)    (if *byte-compiling*
181                 :element-type 'base-char        (values nil t)
182                 :initial-element ,initial-element))        `(make-array (the index ,length)
183                       :element-type 'base-char
184                       :initial-element ,initial-element)))
185    
186  (defconstant array-info  (defconstant array-info
187    '((base-char #\NULL 8 vm:simple-string-type)    '((base-char #\NULL 8 vm:simple-string-type)
# Line 499  Line 504 
504  (macrolet ((frob (reffer setter type)  (macrolet ((frob (reffer setter type)
505               `(progn               `(progn
506                  (def-source-transform ,reffer (a &rest i)                  (def-source-transform ,reffer (a &rest i)
507                    `(aref (the ,',type ,a) ,@i))                    (if *byte-compiling*
508                          (values nil t)
509                          `(aref (the ,',type ,a) ,@i)))
510                  (def-source-transform ,setter (a &rest i)                  (def-source-transform ,setter (a &rest i)
511                    `(%aset (the ,',type ,a) ,@i)))))                    (if *byte-compiling*
512                          (values nil t)
513                          `(%aset (the ,',type ,a) ,@i))))))
514    (frob svref %svset simple-vector)    (frob svref %svset simple-vector)
515    (frob schar %scharset simple-string)    (frob schar %scharset simple-string)
516    (frob char %charset string)    (frob char %charset string)

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

  ViewVC Help
Powered by ViewVC 1.1.5