RFR: 8267303: Replace MinObjectAlignmentSize usages for non-Java heap objects [v2]
Coleen Phillimore
coleenp at openjdk.java.net
Tue Jul 6 21:22:25 UTC 2021
On Tue, 6 Jul 2021 17:31:49 GMT, Ioi Lam <iklam at openjdk.org> wrote:
>> This address_bits here is for using 'this' to join the calculation of identity_hash. I don't think it matters which bits are used here, but we need keep consistency with SA. If you changed here, you need to change Symbol.java too. Note in 32 bits, LogBytesPerWord is different from LogMinObjAlignmentInBytes (it is 3 for both 32 and 64 its).
>
> 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.
-------------
PR: https://git.openjdk.java.net/jdk/pull/4675
More information about the hotspot-dev
mailing list