@Retention(value=RUNTIME) @Target(value=TYPE) public @interface Hybrid
The array length is located directly after the HUB pointer, like in regular array. Then (if present) the type id slots follow. 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 |
+--------------------------------+
| identity hashcode |
+--------------------------------+
| array length |
+--------------------------------+
| type id slots (optional) |
| ... |
+--------------------------------+
| instance fields |
| ... |
+--------------------------------+
| array elements |
: ... :
Currently only the DynamicHub class has a hybrid layout.| Modifier and Type | Required Element and Description |
|---|---|
boolean |
canHybridFieldsBeDuplicated
If
true, we expect that the data in the hybrid fields can be duplicated between the
hybrid object and a separate object for the array or bitset. |
public abstract boolean canHybridFieldsBeDuplicated
true, we expect that the data in the hybrid fields can be duplicated between the
hybrid object and a separate object for the array or bitset. For most objects, a duplication
could occur if inlining and constant folding result in the internal reference to a hybrid
field being constant folded to a constant value, which must be written into the image heap
separately from the hybrid object.
If false, we expect that this duplication of the hybrid fields can never happen.