Integer Slots
The layout of integer slots for my instances.
Entries
The low 32 bits are used for the HASH_OR_ZERO, but the upper 32 can be used by other BitFields in subclasses of TupleDescriptor.
The raw 64-bit (longs) that constitute the representation of the string of two-byte characters. Each long contains up to four characters occupying 16 bits each, in little-endian order. Only the last long can be incomplete, and is required to have zeros for the unused elements. The descriptor instances include the field unusedShortsOfLastLong, which indicates how many (0-3) of the 16-bit subfields of the last long are unused.
Properties
In Java it was possible to define this interface in such a way that the name method was abstract and implemented by each specific Enum, but Kotlin breaks this mechanism. BUT – we're able to cast this to Enum to get to that field. I believe this code gets copied down into each specific Enum subclass, so the dynamic type check for the cast is trivially eliminated in each case. And worst case, Hotspot will be able to inline calls to this from sites that are known to be Enums.
In Java it was possible to define this interface in such a way that the ordinal() method was abstract and implemented by each specific Enum, but Kotlin breaks this mechanism. BUT – we're able to cast this to Enum to get to that field. I believe this code gets copied down into each specific Enum subclass, so the dynamic type check for the cast is trivially eliminated in each case. And worst case, Hotspot will be able to inline calls to this from sites that are known to be Enums.
Functions
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
Returns an array containing the constants of this enum type, in the order they're declared.