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

Aleksey Shipilev shade at openjdk.org
Fri Jan 10 09:56:44 UTC 2025


On Thu, 9 Jan 2025 16:30:49 GMT, Andrew Haley <aph 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?

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

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


More information about the hotspot-dev mailing list