RFR: 8311180: Remove unused unneeded definitions from globalDefinitions [v2]

Coleen Phillimore coleenp at openjdk.org
Sat Jul 1 15:05:15 UTC 2023


On Sat, 1 Jul 2023 10:55:35 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Fix ppc
>
> src/hotspot/cpu/ppc/icache_ppc.hpp line 47:
> 
>> 45:     // Align start address to an icache line boundary and transform
>> 46:     // nbytes to an icache line count.
>> 47:     const uint line_offset = (intptr_t)start & (line_size - 1);
> 
> Drive by comment: This used to be a `uintptr_t` cast, now its `intptr_t`- why signed? Was that a deliberate decision?
> 
> Side question, I always wondered about the widespread use of `intptr_t` in hotspot when casting pointers to integrals, e.g. in `p2i()`. Why a signed integer? E.g. if you then use it for bitwise ops (the major reason why one converts a pointer to an int) it seems more hassle to have to remember the rules for using bitwise operators on signed integers.

Hi Thomas, thanks for noticing.  I messed this one up.

Are you arguing for address_word to avoid this confusion?  That's a lot of reeducation in the code.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/14737#discussion_r1248865829


More information about the hotspot-dev mailing list