RFR: 8357258: x86: Improve receiver type profiling reliability [v3]

John R Rose jrose at openjdk.org
Thu Nov 20 17:14:39 UTC 2025


On Wed, 24 Sep 2025 13:08:14 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 four commits:
> 
>  - Merge branch 'master' into JDK-8357258-x86-c1-optimize-virt-calls
>  - Merge branch 'master' into JDK-8357258-x86-c1-optimize-virt-calls
>  - Drop atomic counters
>  - Initial version

src/hotspot/cpu/x86/macroAssembler_x86.cpp line 4845:

> 4843:         push(temp_reg);
> 4844:         movptr(temp_reg, recv);
> 4845:         recv_reg = temp_reg;

I can mentally do the appropriate `assert_different_registers` here, but an explicit one to confirm would be better.
(Same comment for the next arm of the if/else.)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25305#discussion_r2546917073


More information about the hotspot-compiler-dev mailing list