Class Based Characters

[…]

Unfortunately, enumeration also means we will have to create 256 character classes to implement it. Maintenance of 256 classes without tools is not going to be a lot of fun. Moreover, a subtle side effect is that so many classes might overflow VisualWorks’ virtual machine caches, so performance could be lower than with condensed class based characters.

> And 64k classes for Unicode.

A message that has only one implementation is said to be monomorphic. When a message has multiple implementations it is called polymorphic. If a message has more than just a few implementations, it is considered to be megamorphic. At first, virtual machines were given inline caches (ICs) that kept track of the compiled method for a particular class and selector combination. This saves time because when the information in the IC applies to the message that is about to be sent, then no message lookups are necessary. For polymorphic messages, however, ICs would be reset all the time leading to thrasing. Hence, ICs were extended to hold more than one entry, and thus became polymorphic inline caches, or PICs for short. Eliot Miranda, VisualWorks’ virtual machine guru for many years, described ICs tendency to thrash as “a catastrophe of PIC proportions”. In particular, VisualWorks’ polymorphic inline caches hold “only” 8 entries.

[…]