RFR: 8346890: AArch64: Type profile counters generate suboptimal code [v2]

Andrew Dinn adinn at openjdk.org
Thu Jan 23 11:31:48 UTC 2025


On Fri, 10 Jan 2025 12:42:23 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.
>
> Andrew Haley has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Leave for later

Changes look good apart from a nit over the comment

src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp line 1176:

> 1174:   // Arithmetics
> 1175: 
> 1176:   // Clobber: rscratch2

I'm not entirely sure why this has been added as part of this fix. It's ok as a comment but 1) I'm not sure why you do not also note that `addptr` also clobbers `rscratch1` and 2) `cmpptr` clobbers `rscratch1` but not `rscratch2` but it is not clear that this comment only applies to `addptr`. Perhaps a newline between the two methods would make that clearer.

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

Marked as reviewed by adinn (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/23012#pullrequestreview-2569605141
PR Review Comment: https://git.openjdk.org/jdk/pull/23012#discussion_r1926823070


More information about the hotspot-dev mailing list