RFR: JDK-8314890: Reduce number of loads for Klass decoding in static code [v2]

Thomas Stuefe stuefe at openjdk.org
Tue Aug 29 09:47:10 UTC 2023


On Tue, 29 Aug 2023 08:57:56 GMT, Andrew Haley <aph at openjdk.org> wrote:

>> Thomas Stuefe has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   fix -UseCCP case
>
> src/hotspot/share/oops/compressedKlass.hpp line 74:
> 
>> 72:   static constexpr int bitpos_useccp = shift_bitlen;
>> 73:   static address  base_from_combo()  { return  (address)(_combo & mask_base); }
>> 74:   static int      shift_from_combo() { return  (int)(_combo & right_n_bits(shift_bitlen)); }
> 
> Suggestion:
> 
>   static int      shift() { return  (int)(_combo & right_n_bits(shift_bitlen)); }
> 
> 
> What's the point of the `_from_combo` functions?

They are only used when asserting correctness after initialization. But you are right, I could use `base()` directly.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15389#discussion_r1308506525


More information about the hotspot-dev mailing list