Optimize MAP and MAP-INTO with vector arguments.
* Introduce new optimization quality, INSERT-ARRAY-BOUNDS-CHECKS;
* Use it in the %MAP and MAP-INTO transforms. (We needed something
more fine-grained than (SAFETY 0), because we still want
any necessary type-checking to take place. But we know that
eliminating the bounds checks are safe.)
incompatible element types (thanks to Mario Mommer)
* optimization: method calls with &OPTIONAL or &KEY arguments are faster
and don't cause extra consing
+ * optimization: MAP and MAP-INTO are significantly faster on vectors
+ whose elements types have been declared.
* Improvements to the Windows port:
** floating point exceptions are now reported correctly.
** stack exhaustion detection works partially.
;;; compile-time or we are generating unsafe code, don't bother with
;;; the VOP.
(deftransform %check-bound ((array dimension index) * * :node node)
- (cond ((policy node (and (> speed safety) (= safety 0)))
+ (cond ((policy node (= insert-array-bounds-checks 0))
'index)
((not (constant-lvar-p dimension))
(give-up-ir1-transform))
3
0)
("no" "no" "no" "yes"))
+
+(define-optimization-quality insert-array-bounds-checks
+ (if (= safety 0) 0 3)
+ ("no" "yes" "yes" "yes"))
(tests `(endp ,index))))
((csubtypep type (specifier-type 'vector))
(process-vector `(length ,seq-name))
- (places `(aref ,seq-name index)))
+ (places `(locally (declare (optimize (insert-array-bounds-checks 0)))
+ (aref ,seq-name index))))
(t
(give-up-ir1-transform
"can't determine sequence argument type"))))
:result '(when (array-has-fill-pointer-p result)
(setf (fill-pointer result) index))
:into 'result
- :body '(setf (aref result index) funcall-result))
+ :body '(locally (declare (optimize (insert-array-bounds-checks 0)))
+ (setf (aref result index) funcall-result)))
result)))
\f
;;; 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.9.18.52"
+"0.9.18.53"