* Allows deleting simple unused MAKE-ARRAY and VECTOR combinations.
* Move ASSERT-NO-CONSING and ASSERT-CONSING to compiler-test-util.lisp,
so that they can be used outside dynamic-extent.impure.lisp.
constant two has been optimized.
* optimization: ARRAY-IN-BOUNDS-P is resolved at compile-time when
sufficient type information is available. (thanks to Leslie Polzer)
+ * optimization: unused vector creation can now be optimized away.
* improvement: a STYLE-WARNING is signalled when a generic function
clobbers an earlier FTYPE proclamation.
* improvement: the compiler is able to track the effective type of
(defknown initialize-vector ((simple-array * (*)) &rest t)
(simple-array * (*))
- (always-translatable)
+ (always-translatable flushable)
:result-arg 0)
(defknown vector-fill* (t t t t) vector
(defpackage :compiler-test-util
(:nicknames :ctu)
(:use :cl :sb-c :sb-kernel)
- (:export #:compiler-derived-type
+ (:export #:assert-consing
+ #:assert-no-consing
+ #:compiler-derived-type
#:find-value-cell-values
#:find-named-callees))
(or (not namep)
(equal name (sb-impl::fdefn-name c))))))
collect (sb-impl::fdefn-fun c))))
+
+(defmacro assert-no-consing (form &optional times)
+ `(%assert-no-consing (lambda () ,form) ,times))
+(defun %assert-no-consing (thunk &optional times)
+ (let ((before (sb-ext:get-bytes-consed))
+ (times (or times 10000)))
+ (declare (type (integer 1 *) times))
+ (dotimes (i times)
+ (funcall thunk))
+ (assert (< (- (sb-ext:get-bytes-consed) before) times))))
+
+(defmacro assert-consing (form &optional times)
+ `(%assert-consing (lambda () ,form) ,times))
+(defun %assert-consing (thunk &optional times)
+ (let ((before (sb-ext:get-bytes-consed))
+ (times (or times 10000)))
+ (declare (type (integer 1 *) times))
+ (dotimes (i times)
+ (funcall thunk))
+ (assert (not (< (- (sb-ext:get-bytes-consed) before) times)))))
(let ((f (compile nil `(lambda ()
(labels ((k (&optional x) #'k)))))))
(assert (null (funcall f)))))
+
+(with-test (:name :flush-vector-creation)
+ (let ((f (compile nil `(lambda ()
+ (dotimes (i 1024)
+ (vector i i i))
+ t))))
+ (ctu:assert-no-consing (funcall f))))
(when (eq sb-ext:*evaluator-mode* :interpret)
(sb-ext:quit :unix-status 104))
+(load "compiler-test-util.lisp")
+(use-package :ctu)
+
(setq sb-c::*check-consistency* t
sb-ext:*stack-allocate-dynamic-extent* t)
(setf (gethash 5 *table*) 13)
(gethash 5 *table*))
\f
-(defmacro assert-no-consing (form &optional times)
- `(%assert-no-consing (lambda () ,form) ,times))
-(defun %assert-no-consing (thunk &optional times)
- (let ((before (get-bytes-consed))
- (times (or times 10000)))
- (declare (type (integer 1 *) times))
- (dotimes (i times)
- (funcall thunk))
- (assert (< (- (get-bytes-consed) before) times))))
-
-(defmacro assert-consing (form &optional times)
- `(%assert-consing (lambda () ,form) ,times))
-(defun %assert-consing (thunk &optional times)
- (let ((before (get-bytes-consed))
- (times (or times 10000)))
- (declare (type (integer 1 *) times))
- (dotimes (i times)
- (funcall thunk))
- (assert (not (< (- (get-bytes-consed) before) times)))))
-
(defvar *a-cons* (cons nil nil))
(progn
;;; 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.30.33"
+"1.0.30.34"