From 88439f4753b11506772bac003ca43c4687a75e26 Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Wed, 6 Jun 2007 02:23:46 +0000 Subject: [PATCH] 1.0.6.29: improved WITH-ARRAY-DATA on simple multi-dimensional arrays * Instead of looping to find the underlying one-dimensional simple array, just return it directly. --- src/compiler/array-tran.lisp | 21 +++++++++++++++++---- version.lisp-expr | 2 +- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/compiler/array-tran.lisp b/src/compiler/array-tran.lisp index 0d47738..9b0612e 100644 --- a/src/compiler/array-tran.lisp +++ b/src/compiler/array-tran.lisp @@ -666,10 +666,23 @@ :node node :policy (> speed space)) "inline non-SIMPLE-vector-handling logic" - (let ((element-type (upgraded-element-type-specifier-or-give-up array))) - `(%with-array-data-macro array start end - :unsafe? ,(policy node (= safety 0)) - :element-type ,element-type))) + (let ((element-type (upgraded-element-type-specifier-or-give-up array)) + (type (lvar-type array))) + (if (and (array-type-p type) + (listp (array-type-dimensions type)) + (not (null (cdr (array-type-dimensions type))))) + ;; If it's a simple multidimensional array, then just return its + ;; data vector directly rather than going through + ;; %WITH-ARRAY-DATA-MACRO. SBCL doesn't generally generate code + ;; that would use this currently, but we have encouraged users + ;; to use WITH-ARRAY-DATA and we may use it ourselves at some + ;; point in the future for optimized libraries or similar. + `(let ((data (truly-the (simple-array ,element-type (*)) + (%array-data-vector array)))) + (values data 0 (length data) 0)) + `(%with-array-data-macro array start end + :unsafe? ,(policy node (= safety 0)) + :element-type ,element-type)))) ;;;; array accessors diff --git a/version.lisp-expr b/version.lisp-expr index fafe327..2f32317 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -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".) -"1.0.6.28" +"1.0.6.29" -- 1.7.10.4