@Retention(value=RUNTIME) @Target(value=TYPE) public @interface Hybrid
BitSet
are directly placed within the class layout. This saves one indirection
when accessing the array or bit-set.
The array length is located directly after the HUB pointer, like in regular array. Then (if present) the bits are located. Then the instance fields are placed. Then, with the default GC, there is an optional identity hashcode. At the end of the layout, the array elements are located.
+--------------------------------+ | pointer to DynamicHub | +--------------------------------+ | Array length | +--------------------------------+ | bits | type id slots (optional)| | ... | +--------------------------------+ | instance fields | | ... | +--------------------------------+ | identity hashcode (optional) | +--------------------------------+ | array elements | : ... :Currently only the
DynamicHub
class has a hybrid layout.