RFR: 8358655: AArch64: Simplify Interpreter::profile_taken_branch

Andrew Haley aph at openjdk.org
Fri Jun 20 09:05:27 UTC 2025


On Fri, 20 Jun 2025 08:24:40 GMT, Andrew Haley <aph at openjdk.org> wrote:

>> [JDK-8358655](https://bugs.openjdk.org/browse/JDK-8358655)
>> 
>> The aarch64 version of [JDK-8357434](https://bugs.openjdk.org/browse/JDK-8357434)
>> 
>> The counter is 64-bit, never practically overflows, and no other code cares about it so it is safe to remove
>> 
>> Additional Testing:
>> - [x] Linux aarch64 fastdebug tier 1
>> - [x] Linux aarch64 fastdebug tier 2
>> - [x] Linux aarch64 fastdebug tier 3
>> - [x] Linux aarch64 fastdebug tier 4
>
> Marked as reviewed by aph (Reviewer).

> Looks fine. I also think `r1` saves are now unnecessary, right, @theRealAph?
> 
> ```
>     // ECN: FIXME: This code smells
>     // check if MethodCounters exists
>     Label has_counters;
>     __ ldr(rscratch1, Address(rmethod, Method::method_counters_offset()));
>     __ cbnz(rscratch1, has_counters);
>     __ push(r0);
>     __ push(r1); // <--- here
>     __ push(r2);
>     __ call_VM(noreg, CAST_FROM_FN_PTR(address,
>             InterpreterRuntime::build_method_counters), rmethod);
>     __ pop(r2);
>     __ pop(r1);  // <--- here
>     __ pop(r0);
> ```

I thinks so, but at a first glance `r1` seems to be clobbered on all code paths immediately after this, so I don't think it's needed anyway,

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

PR Comment: https://git.openjdk.org/jdk/pull/25906#issuecomment-2990366304


More information about the hotspot-compiler-dev mailing list