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

Vladimir Ivanov vlivanov at openjdk.org
Fri Apr 12 23:52:45 UTC 2024


On Fri, 12 Apr 2024 23:30:29 GMT, Dean Long <dlong at openjdk.org> wrote:

>> Andrew Haley has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   JDK-8180450: secondary_super_cache does not scale well
>
> src/hotspot/share/oops/klass.cpp line 459:
> 
>> 457: }
>> 458: 
>> 459: uint8_t Klass::compute_home_slot(Klass* k, uintx bitmap) {
> 
> This could use some comments, because it's not doing what I would expect, if this should match the asm code.  Here, we never call population_count() on the full bitmap (shift 0), unlike the asm code.

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);

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

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


More information about the hotspot-dev mailing list