RFR: 8318159: RISC-V: Improve itable_stub

Yuri Gaevsky duke at openjdk.org
Tue Nov 14 15:09:42 UTC 2023


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


#### Performance results on RISC-V THead board:


InterfaceCalls:                   before fix         after fix
---------------------------------------------------------------------
Benchmark         Mode  Cnt    Score   Error     Score   Error  Units
---------------------------------------------------------------------
test1stInt2Types  avgt  100   33.326 ? 0.184 |  33.501 ? 0.237  ns/op
test1stInt3Types  avgt  100  111.881 ? 0.707 | 109.882 ? 0.664  ns/op
test1stInt5Types  avgt  100  115.059 ? 0.728 | 113.751 ? 0.532  ns/op
test2ndInt2Types  avgt  100   34.784 ? 0.437 |  34.725 ? 0.412  ns/op
test2ndInt3Types  avgt  100  115.042 ? 0.518 | 113.346 ? 0.543  ns/op
test2ndInt5Types  avgt  100  114.700 ? 1.214 | 112.871 ? 1.203  ns/op
testIfaceCall     avgt  100  114.211 ? 1.023 | 113.747 ? 1.323  ns/op
testIfaceExtCall  avgt  100  116.485 ? 0.864 | 113.872 ? 1.275  ns/op
testMonomorphic   avgt  100   31.404 ? 0.236 |  32.133 ? 0.802  ns/op
---------------------------------------------------------------------

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

Commit messages:
 - 8318159: RISC-V: Improve itable_stub

Changes: https://git.openjdk.org/jdk/pull/16657/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16657&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8318159
  Stats: 134 lines in 3 files changed: 115 ins; 15 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/16657.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/16657/head:pull/16657

PR: https://git.openjdk.org/jdk/pull/16657


More information about the hotspot-dev mailing list