RFR: 8346890: AArch64: Type profile counters generate suboptimal code

Andrew Haley aph at openjdk.org
Fri Jan 10 12:04:34 UTC 2025


On Fri, 10 Jan 2025 09:54:12 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> Type profile counters are emitted many times in C1-generated code. The generator was written a long time ago before we knew how best to write AArch64 code, and the generated code is rather suboptimal.
>> 
>> This PR reduces the size of a typical bimorphic type profile counter from 33 to 27 instructions.
>
> src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp line 1384:
> 
>> 1382:     vtable_offset_in_bytes += vtable_index.as_constant() * wordSize;
>> 1383:     ldr(method_result,
>> 1384:         form_address(rscratch1, recv_klass, vtable_offset_in_bytes, LogBytesPerWord));
> 
> What is this change? Does not look equivalent to current code. Is this a bug fix?

It's just something I noticed while scanning all of the calls to form_address. The shift should match the operand size.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23012#discussion_r1910283059


More information about the hotspot-dev mailing list