Using the Klass gap (Was: Master Thesis on Shenandoah)

Zhengyu Gu zgu at redhat.com
Tue Jan 2 13:52:50 UTC 2018



On 01/02/2018 06:23 AM, Roman Kennke wrote:
> Am 01.01.2018 um 21:29 schrieb Martin Grajcar:
>>> * Am 08.11.2017 um 19:07 schrieb Dominik Inführ:*
>>
>> I was pondering the idea to squeeze the fwd ptr into the so-called
>>> Klass-gap. This is 32 unused bits when the Klass* is compressed. It's
>>> only available for non-arrays, because for arrays, the array-length is
>>> squeezed into those 32bits.
>>
>>
>> A possibly stupid question, but shouldn't it be the other way round?
>>
>> Currently, array length gets packed in a gap and you're thinking about
>> using the gap -- when available -- for the fwd ptr. This sounds slow and
>> complicated/
>>
>> Can't you instead *always* use this gap for non-arrays and use a new slot
>> for the array length? This saves memory for non-arrays in exactly the 
>> same
>> way and needs no new conditional logic (I guess, arrays can already deal
>> with the case they need a new slot  for their length).
> 
> Yes, this sounds like an attractive possibility. :-)

Agree. I think Java will have to switch to 64-bit array index at some point.

-Zhengyu

> 
> Thanks,
> Roman
> 


More information about the shenandoah-dev mailing list