* optimization: typechecking alien values is typically 5 x faster.
* optimization: FDEFINITION, SYMBOL-FUNCTION, MACRO-FUNCTION, and FBOUNDP
are 20% faster.
+ * bug fix: file compilation performance issues when dumping subtypes
+ of CHARACTER (lp#994487)
* bug fix: fixed disassembly of some SSE instructions on x86-64.
* bug fix: SB-SIMPLE-STREAMS signals an error for bogus :CLASS arguments in
OPEN. (lp#969352, thanks to Kambiz Darabi)
((type= type (specifier-type 'base-char)) 'base-char)
((type= type (specifier-type 'extended-char)) 'extended-char)
((type= type (specifier-type 'standard-char)) 'standard-char)
- (t (let ((pairs (character-set-type-pairs type)))
- `(member ,@(loop for (low . high) in pairs
+ (t
+ ;; Unparse into either MEMBER or CHARACTER-SET. We use MEMBER if there
+ ;; are at most as many characters than there are character code ranges.
+ (let* ((pairs (character-set-type-pairs type))
+ (count (length pairs))
+ (chars (loop named outer
+ for (low . high) in pairs
nconc (loop for code from low upto high
- collect (sb!xc:code-char code))))))))
+ collect (sb!xc:code-char code)
+ when (minusp (decf count))
+ do (return-from outer t)))))
+ (if (eq chars t)
+ `(character-set ,pairs)
+ `(member ,@chars))))))
(!define-type-method (character-set :singleton-p) (type)
(let* ((pairs (character-set-type-pairs type))
(assert-coercion (code-char 955) character)
(assert-coercion 'a character)
(assert-coercion "a" character)))
+
+(with-test (:name :bug-994487)
+ (let ((f (compile nil `(lambda (char)
+ (code-char (1+ (char-code char)))))))
+ (assert (equal `(function (t) (values (sb-kernel:character-set ((1 . 1114111)))
+ &optional))
+ (sb-impl::%fun-type f)))))