Doing so means dumping a list containing most of unicode for each
function that return something like
(code-char (+ <const> <(integer 0)>))
which has a derived type (CHARACTER-SET ((<const> . 1114111))).
Instead, pick whichever is more compact, using number of characters
vs number of character code ranges as the deciding factor.
This means that users can see SB-KERNEL:CHARACTER-SET types in
eg. output from DESCRIBE or as return values from
SB-INTROSPECT:FUNCTION-TYPE -- which is suboptimal, but less bad
than such types slowing us down as horribly as they do prior to this
change.
At some point, however, we should document and export SB-EXT:CHARSET
or something -- but I don't want to think of the issues associated
with a public interface right now.
* optimization: typechecking alien values is typically 5 x faster.
* optimization: FDEFINITION, SYMBOL-FUNCTION, MACRO-FUNCTION, and FBOUNDP
are 20% faster.
* 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)
* 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)
((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
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))
(!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)))
(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)))))