* Patch by Paul Khuong.
* improvement: GET-SETF-EXPANDER avoids adding bindings for constant
arguments, making compiler-macros for SETF-functions able to inspect
their constant arguments.
+ * optimization: CHAR-CODE type derivation has been improved, making
+ TYPEP elimination on subtypes of CHARACTER work better. (reported
+ by Tobias Rittweiler, patch by Paul Khuong)
changes in sbcl-1.0.24 relative to 1.0.23:
* new feature: ARRAY-STORAGE-VECTOR provides access to the underlying data
(declare (dynamic-extent l))
(mapc #'print l))))
-Result of MAKE is not stack allocated, which means that
-stack-allocation of structures is impossible.
+Result of MAKE is not stack allocated.
--------------------------------------------------------------------------------
#22
IR2 does not perform unused code flushing.
(hi-res (if hi (isqrt hi) '*)))
(specifier-type `(integer ,lo-res ,hi-res))))))
+(defoptimizer (char-code derive-type) ((char))
+ (let ((type (type-intersection (lvar-type char) (specifier-type 'character))))
+ (cond ((member-type-p type)
+ (specifier-type
+ `(member
+ ,@(loop for member in (member-type-members type)
+ when (characterp member)
+ collect (char-code member)))))
+ ((sb!kernel::character-set-type-p type)
+ (specifier-type
+ `(or
+ ,@(loop for (low . high)
+ in (character-set-type-pairs type)
+ collect `(integer ,low ,high)))))
+ ((csubtypep type (specifier-type 'base-char))
+ (specifier-type
+ `(mod ,base-char-code-limit)))
+ (t
+ (specifier-type
+ `(mod ,char-code-limit))))))
+
(defoptimizer (code-char derive-type) ((code))
(let ((type (lvar-type code)))
;; FIXME: unions of integral ranges? It ought to be easier to do
nil)
(assert (eq 'list type))
(assert derivedp)))
+
+(with-test (:name :base-char-typep-elimination)
+ (assert (eq (funcall (lambda (ch)
+ (declare (type base-char ch) (optimize (speed 3) (safety 0)))
+ (typep ch 'base-char))
+ t)
+ t)))
;;; 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.24.6"
+"1.0.24.7"