RFR: 8180450: secondary_super_cache does not scale well [v14]

Dean Long dlong at openjdk.org
Sat Apr 13 00:19:43 UTC 2024


On Fri, 12 Apr 2024 23:50:26 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:

>> Neither do we do that in assembly code [1] [2]. `Klass::compute_home_slot` is equivalent to what happens in MacroAssembler (modulo some micro-optimizations).
>> 
>> 
>> [1] macroAssembler_x86.cpp:
>> ``` 
>> ...
>>     int shift_count = Klass::SECONDARY_SUPERS_TABLE_MASK - bit;
>>     if (shift_count != 0) {
>>       salq(r_array_index, shift_count);
>>     } else {
>>       testq(r_array_index, r_array_index);
>>     }
>> ...
>>   if (bit != 0) {
>>     popcntq(r_array_index, r_array_index);
>> 
>> 
>> [2] macroAssembler_aarch64.cpp:
>> 
>>   if (bit != 0) {
>>     shld(vtemp, vtemp, Klass::SECONDARY_SUPERS_TABLE_MASK - bit);
>>     cnt(vtemp, T8B, vtemp);
>>     addv(vtemp, T8B, vtemp);
>>     fmovd(r_array_index, vtemp);
>
> Are you asking about `if (hash > 0) {` check?

No, in the asm code, when bit == SECONDARY_SUPERS_TABLE_MASK (MSB), we do popcnt on the full bitmap.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18309#discussion_r1563410918


More information about the hotspot-dev mailing list