Far classes
Thomas Schatzl
thomas.schatzl at oracle.com
Tue Jun 18 16:25:24 UTC 2024
On 18.06.24 14:23, Thomas Stüfe wrote:
> Hi,
>
[...]
>
> So: 3) Store Klass* in the object:
>
> We dedicate one bit in the nKlass for "is-far-class". For far classes,
> we store the Klass* at the end of the object. Then we encode the offset
> of the Klass* slot in the remaining nKlass bits.
>
> That depends on max. object size. How large does an object get? I found
> no limit in specs. However, the size of an object depends on its
> members, and we have an utf-8 CP-entry per member, and the number of CP
> entries is limited to 2^16. So, an object cannot have more than 65535
> members (a bit less, actually). Therefore, I think it cannot be larger
> than 64k heap words.
A child class of a class with 64k members can have 64k members again
afair. Not sure if there is a limit on the inheritance level. I remember
some tests constructing such huge objects for testing some GC algorithms.
So j.l.O. instances can be of "arbitrary" size afaik.
Hth,
Thomas
More information about the lilliput-dev
mailing list