RFR: 8318159: RISC-V: Improve itable_stub
Robbin Ehn
rehn at openjdk.org
Mon Nov 20 09:03:32 UTC 2023
On Tue, 14 Nov 2023 15:01:51 GMT, Yuri Gaevsky <duke at openjdk.org> wrote:
> Please review the change for RISC-V similar to #13792(AARCH64) and #13460(X86).
>
> From #13792:
> The change replaces two separate iterations over the itable with new algorithm
> consisting of two loops. First, we look for a match with resolved_klass,
> checking for a match with holder_klass along the way. Then we continue iterating
> (not starting over) the itable using the second loop, checking only for a match
> with holder_klass.
>
> ### Correctness checks
>
> Testing: tier1 tests successfully passed on HiFive Unmatched board.
>
> #### Performance results on RISC-V StarFive JH7110 board:
>
>
> InterfaceCalls: before fix after fix
> -------------------------------------------------------------------
> Benchmark Mode Cnt Score Error Score Error Units
> -------------------------------------------------------------------
> test1stInt2Types avgt 100 14.380 ? 0.017 | 14.370 ? 0.014 ns/op
> test1stInt3Types avgt 100 72.724 ? 0.552 | 66.290 ? 0.080 ns/op
> test1stInt5Types avgt 100 73.948 ? 0.524 | 68.781 ? 0.377 ns/op
> test2ndInt2Types avgt 100 15.705 ? 0.016 | 15.707 ? 0.018 ns/op
> test2ndInt3Types avgt 100 82.370 ? 0.453 | 75.363 ? 0.156 ns/op
> test2ndInt5Types avgt 100 85.266 ? 0.466 | 80.969 ? 0.752 ns/op
> testIfaceCall avgt 100 75.684 ? 0.648 | 72.603 ? 0.460 ns/op
> testIfaceExtCall avgt 100 86.293 ? 0.567 | 77.939 ? 0.340 ns/op
> testMonomorphic avgt 100 11.357 ? 0.007 | 11.359 ? 0.009 ns/op
> -------------------------------------------------------------------
>
>
> #### Performance results on RISC-V HiFive Unmatched board:
>
>
> InterfaceCalls: before fix after fix
> ---------------------------------------------------------------------
> Benchmark Mode Cnt Score Error Score Error Units
> ---------------------------------------------------------------------
> test1stInt2Types avgt 100 24.432 ? 1.811 | 23.205 ? 1.512 ns/op
> test1stInt3Types avgt 100 135.800 ? 3.991 | 127.112 ? 2.299 ns/op
> test1stInt5Types avgt 100 141.746 ? 4.272 | 136.069 ? 4.919 ns/op
> test2ndInt2Types avgt 100 31.474 ? 2.468 | 26.978 ? 1.951 ns/op
> test2ndInt3Types avgt 100 146.410 ? 3.575 | 139.443 ? 3.677 ns/op
> test2ndInt5Types avgt 100 156.083 ? 3.617 | 150.583 ? 2.909 ns/op
> testIfaceCall avgt 100 136.392 ? 2.546 | 129.632 ? 1.662 ns/op
> testIfaceExtCall avgt 100 155.602 ? 3.836 | 138.058 ? 2.147 ns/op
> testMonomorphic avgt 100 24.018 ? 1.888 | 21.522 ? 1.662 ns/op
> ---------...
Marked as reviewed by rehn (Reviewer).
src/hotspot/cpu/riscv/macroAssembler_riscv.cpp line 2548:
> 2546: int itmentry_off_bytes = in_bytes(itableMethodEntry::method_offset());
> 2547: int vte_size_bytes = vtableEntry::size_in_bytes();
> 2548: const int vte_scale = 3;
exact_log2(vtableEntry::size_in_bytes())
src/hotspot/cpu/riscv/macroAssembler_riscv.cpp line 2557:
> 2555: // + sizeof(vtableEntry) * (recv_klass->_vtable_len);
> 2556: // temp_itbl_klass = itable[0]._interface;
> 2557: assert(vte_size_bytes == wordSize, "else adjust vte_scale");
exact_log2 have assert so you can then remove this one.
-------------
PR Review: https://git.openjdk.org/jdk/pull/16657#pullrequestreview-1739226219
PR Review Comment: https://git.openjdk.org/jdk/pull/16657#discussion_r1398827699
PR Review Comment: https://git.openjdk.org/jdk/pull/16657#discussion_r1398831298
More information about the hotspot-dev
mailing list