RFR: 8342881: RISC-V: secondary_super_cache does not scale well: C1 and interpreter [v4]

Fei Yang fyang at openjdk.org
Tue Dec 10 03:44:39 UTC 2024


On Mon, 9 Dec 2024 03:01:16 GMT, Gui Cao <gcao at openjdk.org> wrote:

>> Follow this patch https://github.com/openjdk/jdk/pull/19989, The fix for [JDK-8332587](https://bugs.openjdk.org/browse/JDK-8332587) was for C2 only. Implement the same fix for C1 and the interpreter.
>> 
>> ### Testing
>> - [x] Run tier1-3 tests on SOPHON SG2042 (release)
>
> Gui Cao has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision:
> 
>  - Merge remote-tracking branch 'upstream/master' into JDK-8342881
>  - 8342881: RISC-V: secondary_super_cache does not scale well: C1 and interpreter

src/hotspot/cpu/riscv/c1_Runtime1_riscv.cpp line 892:

> 890:                                          nullptr, /*L_success*/
> 891:                                          &miss    /*L_failure*/);
> 892: 

Could you please add a code comment about extra regsiters used for table lookup? We reserve several more in `MacroAssembler::check_klass_subtype_slow_path_table`.

src/hotspot/cpu/riscv/macroAssembler_riscv.cpp line 2882:

> 2880:   assert_different_registers(src, tmp);
> 2881: 
> 2882:   li(tmp, 64);

Suggestion: `mv(tmp, 64);`

src/hotspot/cpu/riscv/macroAssembler_riscv.cpp line 4350:

> 4348:   tmp3_reg = allocate_if_noreg(tmp3_reg, available_regs, pushed_regs);
> 4349:   tmp4_reg = allocate_if_noreg(tmp4_reg, available_regs, pushed_regs);
> 4350:   tmp5_reg = allocate_if_noreg(tmp5_reg, available_regs, pushed_regs);

`tmp5_reg` allocated but not used here?

src/hotspot/cpu/riscv/stubGenerator_riscv.cpp line 3018:

> 3016:     __ lookup_secondary_supers_table_const(r_sub_klass, r_super_klass, result,
> 3017:                                            r_array_base, r_array_length, r_array_index,
> 3018:                                            r_bitmap, super_klass_index, true);

Maybe add some code comment the final param, like: `/*stub_is_near*/true`

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21922#discussion_r1877233295
PR Review Comment: https://git.openjdk.org/jdk/pull/21922#discussion_r1875334741
PR Review Comment: https://git.openjdk.org/jdk/pull/21922#discussion_r1877229921
PR Review Comment: https://git.openjdk.org/jdk/pull/21922#discussion_r1877183603


More information about the hotspot-dev mailing list