RFR: 8357258: x86: Improve receiver type profiling reliability [v5]
Andrew Haley
aph at openjdk.org
Fri Nov 28 15:25:01 UTC 2025
On Wed, 26 Nov 2025 15:55:38 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
>> See the bug for discussion what issues current machinery has.
>>
>> This PR executes the plan outlined in the bug:
>> 1. Common the receiver type profiling code in interpreter and C1
>> 2. Rewrite receiver type profiling code to only do atomic receiver slot installations
>> 3. Trim `C1OptimizeVirtualCallProfiling` to only claim slots when receiver is installed
>>
>> This PR does _not_ do atomic counter updates themselves, as it may have much wider performance implications, including regressions. This PR should be at least performance neutral.
>>
>> Additional testing:
>> - [x] Linux x86_64 server fastdebug, `compiler/`
>> - [x] Linux x86_64 server fastdebug, `all`
>
> Aleksey Shipilev has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 15 commits:
>
> - Merge branch 'master' into JDK-8357258-x86-c1-optimize-virt-calls
> - Tighten up some more
> - Offset is always rscratch1, no need to save it
> - Grossly simplify register shuffling
> - More asserts
> - More comment touchups
> - Inline code comments
> - Mention the updater in ReceiverTypeData
> - type_profile -> profile_receiver_type
> - Stylistic: remove redundant assert
> - ... and 5 more: https://git.openjdk.org/jdk/compare/c028369d...c441209a
I'm seeing minor performance regressions in `InterfaceCalls.test2ndInt5Types`, before and after this PR:
Mainline:
Benchmark (randomized) Mode Cnt Score Error Units
InterfaceCalls.test2ndInt5Types false avgt 4 28.185 ± 0.538 ns/op
InterfaceCalls.test2ndInt5Types:IPC false avgt 2.232 insns/clk
InterfaceCalls.test2ndInt5Types:branch-misses:u false avgt 0.342 #/op
InterfaceCalls.test2ndInt5Types:instructions:u false avgt 206.028 #/op
This PR:
Benchmark (randomized) Mode Cnt Score Error Units
InterfaceCalls.test2ndInt5Types false avgt 4 32.247 ± 0.109 ns/op
InterfaceCalls.test2ndInt5Types:IPC false avgt 2.231 insns/clk
InterfaceCalls.test2ndInt5Types:branch-misses:u false avgt 0.561 #/op
InterfaceCalls.test2ndInt5Types:instructions:u false avgt 238.324 #/op
model name : Intel(R) Xeon(R) Platinum 8275CL CPU @ 3.00GHz
java -XX:+UnlockExperimentalVMOptions -XX:ProfileCaptureRatio=1 -jar /home/aph/theRealAph-jdk/build/linux-x86_64-server-release/images/test/micro/benchmarks.jar test2ndInt5Types -p randomized=false -f 1 -jvmArgs ' -XX:TieredStopAtLevel=3' -t 1 -prof perfnorm
-------------
PR Comment: https://git.openjdk.org/jdk/pull/25305#issuecomment-3589699041
More information about the hotspot-dev
mailing list