RFR: 8267303: Replace MinObjectAlignmentSize usages for non-Java heap objects
Yumin Qi
minqi at openjdk.java.net
Tue Jul 6 16:51:53 UTC 2021
On Tue, 6 Jul 2021 15:54:19 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>> src/hotspot/share/oops/symbol.hpp line 158:
>>
>>> 156: static int max_length() { return max_symbol_length; }
>>> 157: unsigned identity_hash() const {
>>> 158: unsigned addr_bits = (unsigned)((uintptr_t)this >> (LogBytesPerWord + 3));
>>
>> [pre-existing] I'm puzzled by the `+3` in this line. I'm guessing this is `log2(sizeof(Symbol))`?
>
> Oh that might be a good guess. I thought it was just some way to randomize the address some more. @yminqi or @iklam would know since it was added with JDK-8130115.
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).
-------------
PR: https://git.openjdk.java.net/jdk/pull/4675
More information about the hotspot-dev
mailing list