On Mon, 30 Mar 2026 14:29:11 GMT, Aleksey Shipilev <[email protected]> wrote:

> And are we sure on AArch64 it does not? I don't see a similar change there.

I'm sure. AArch64 uses `cbz`.

> I see at least this in `LIR_Assembler::increment_profile_ctr` on AArch64:
> 
> ```
>         if (!step->is_constant()) {
>           // If step is 0, make sure the stub check below always fails
>           __ cmp(step->as_register(), (u1)0);
>           __ mov(rscratch1, InvocationCounter::count_increment * 
> ProfileCaptureRatio);
>           __ csel(dest, dest, rscratch1, __ NE);
>         }
> ```

That snippet above is executed only for counters that may overflow.

> Also ugh, doing two tests just to restore the flags. But that one seems 
> unavoidable.

I think so. There seems to be no better way to do it.

> src/hotspot/cpu/arm/c1_MacroAssembler_arm.cpp line 256:
> 
>> 254: 
>> 255: void C1_MacroAssembler::step_random(Register state, Register temp, 
>> Register data) {
>> 256:   // if (VM_Version::supports_crc32()) {
> 
> Can be just deleted, IMO.

I guess so. There seems no way to test the feature flags on Arm 32.

> src/hotspot/share/c1/c1_LIR.cpp line 1082:
> 
>> 1080:     (_step, _result, _freq_op,
>> 1081:      _md_reg, _md_op, _md_offset_op, _overflow_stub);
>> 1082:   if (overflow_stub()) {
> 
> `overflow_stub() != nullptr`

Yuck. OK. :-)

> src/hotspot/share/compiler/compiler_globals.hpp line 391:
> 
>> 389:           "information at the bailout point")                           
>>     \
>> 390:                                                                         
>>     \
>> 391:   product(int, ProfileCaptureRatio, 1, EXPERIMENTAL,                    
>>     \
> 
> Put it at `64`, if you believe this is a right tradeoff.

This is an experimental patch. I don't think I should turn an experiment on by 
default.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28541#discussion_r3010816929
PR Review Comment: https://git.openjdk.org/jdk/pull/28541#discussion_r3010818885
PR Review Comment: https://git.openjdk.org/jdk/pull/28541#discussion_r3010823337
PR Review Comment: https://git.openjdk.org/jdk/pull/28541#discussion_r3010828593

Reply via email to