Call for Discussion: New Project: Lilliput

John Rose john.r.rose at oracle.com
Sun Mar 14 04:44:03 UTC 2021


On Mar 12, 2021, at 2:50 PM, Roman Kennke <rkennke at redhat.com> wrote:
> 
>> 
>>   I had done experiments with a klass pointer indirection, which could effectively be a klass index.
> 
> I had a little exchange with Thomas Stuefe, and we believe we can split Klass into fixed-sized part, and variable-sized part, have the fixed-size base reference the variable-sized part. Then we can allocate the fixed Klass instances into a 'flat' array in a contiguous memory region, and with some smart placement and aligmment we can use a compressed pointer to address it, which will effectively be an index into that array. Which means that with N bits of compressed-class-pointer we could address 2^N Klasses :-) No indirection needed if done so afaict.

Coleen and I discussed similar work several years ago.
My recollection is that there was a problem (at the time)
with v-table access, because of the extra indirection.
It may well have gotten worse in recent years.

I also think the fixed-part/variable-sized part (aka. near klass
and far klass) are likely to be a winning idea, in part because
we may wish to have a larger number of near-klasses than
far-klasses when we start doing specialized classes.

I suggest making the size of the fixed-sized block (near-klass)
configurable via a build-time or even run-time parameter.
That would allow the first N items in the v-table to spill
into the near-class, and avoid the indirection penalty for
the first N virtual methods in any given class.

I suppose Gil’s team experimented with something like
this before settling on “kids” pointing to pointers, which
are the minimum size of a near-klass (64 bits).  Maybe they
may have some further experience with this.

— John


More information about the discuss mailing list