RFR: 8267303: Replace MinObjectAlignmentSize usages for non-Java heap objects [v2]
Coleen Phillimore
coleenp at openjdk.java.net
Tue Jul 6 21:29:49 UTC 2021
On Tue, 6 Jul 2021 21:16:29 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>> I agree that the `+3` can be replaced with `log2(sizeof(Symbol))`. If I remember correctly, the intention was to avoid getting the same value for `(((uintptr_t)this) >> LogBytesPerWord) & 0x07)`.
>>
>> However, this may not be necessary. The Symbols are of variable sizes (the string body is allocated as part of the Symbol). I write a program to analyze the distribution of the above expression for 18487 Symbols allocated for running a HelloWorld Java program. While it's not perfectly distributed, it may be good enough.
>>
>> Perhaps we can get rid of the `+ 3` or `+ log2(sizeof(Symbol))` in a separate RFE?
>>
>>
>> 0: +++++++
>> 1: +++++++++++++++++++++++++++++++++++++++
>> 2: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>> 3: ++++++++++++++++++++++++++++++++++++++++++++++
>> 4: ++++++++++++++++++++++++++++++
>> 5: ++++++++++++++++++++++
>> 6: +++++++++++++++
>> 7: ++++++++++
>>
>> 0: 571
>> 1: 3152
>> 2: 4659
>> 3: 3721
>> 4: 2467
>> 5: 1801
>> 6: 1276
>> 7: 838
>
> Thanks Yumin for pointing out the SA dependencies. It turns out that this function isn't ultimately used by the SA anymore, but I've made the changes anyway.
I'd be happy if someone changed the 3 to log2(sizeof(Symbol) in another RFE since I'm having trouble commenting why this is important.
-------------
PR: https://git.openjdk.java.net/jdk/pull/4675
More information about the hotspot-dev
mailing list