Make sb-int:misc-index foldable, flushable

This commit is contained in:
Stas Boukarev 2026-06-29 17:14:19 +03:00
parent ab6fa91796
commit ca75aca96a
4 changed files with 7 additions and 7 deletions

View file

@ -664,7 +664,7 @@ For structures:
@item @code{slot-value} and @code{slot-boundp} function as expected, including (for
@code{slot-value}) calling and respecting the return value of
@code{slot-unbound} if the slot is unbound;
@code{slot-unbound} if the slot is unbound;
@item @code{(setf slot-value)} functions as expected, including performing
type checks to verify that the new value is of an appropriate type

View file

@ -393,7 +393,7 @@ Note that @code{do} appears in the processing path. This is because
@cindex macroexpansion
@cindex source transform
The rest of the processing path results from the macroexpansion of
@code{do}:
@code{do}:
@example
(block nil

View file

@ -214,16 +214,16 @@
;;; Primary composition information is stored in a hash table local to
;;; PRIMARY-COMPOSITION, with (+ (ash codepoint1 21) codepoint2) as
;;; keys and the composition as the value
(eval-when (:compile-toplevel :load-toplevel :execute)
(sb-c:defknown misc-index (character) (integer 0 #.(- (length sb-unicode::+character-misc-database+) +misc-width+))
(sb-c:foldable sb-c:flushable sb-c::no-verify-arg-count)
:overwrite-fndb-silently t))
(defun misc-index (char)
(misc-index-from-char-code (char-code char)
sb-unicode::+character-high-pages+
sb-unicode::+character-low-pages+))
(aver (csubtypep (global-ftype 'misc-index)
(specifier-type '(sfunction (t) (unsigned-byte 16)))))
(proclaim `(ftype ,(type-specifier (global-ftype 'misc-index)) misc-index))
(declaim (ftype (sfunction (t) (unsigned-byte 8)) ucd-general-category)
(inline ucd-general-category))
(defun ucd-general-category (char)

View file

@ -2236,7 +2236,7 @@ core and return a descriptor to it."
(if (symbolp name) (cold-intern name) name))))
(let ((existing (read-wordindexed fdefn sb-vm:fdefn-fun-slot)))
(unless (or (cold-null existing) (descriptor= existing function))
(error "Function multiply defined: ~S. Was ~x is ~x" name
(cerror "Overwrite" "Function multiply defined: ~S. Was ~x is ~x" name
(descriptor-bits existing)
(descriptor-bits function))))
(write-wordindexed fdefn sb-vm:fdefn-fun-slot function)