RFR: 8367989: Remove InstanceKlass::allocate_objArray and ArrayKlass::allocate_arrayArray [v3]
Coleen Phillimore
coleenp at openjdk.org
Fri Sep 19 15:31:47 UTC 2025
On Fri, 19 Sep 2025 13:26:08 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:
>> It might make sense to refactor allocate_arrayArray into this though and remove that too.
>> Yes, I like suggestion #1. There are too many array allocation functions.
>
>> It wasn't really symmetric except number of lines.
>
> Given that you refuted my statement about symmetry I want to try to explain what symmetry I saw but you didn't:
>
> The old code called allocate_xArray function in both branches. That was the symmetry. It was quite clear that the two functions accomplished similar goals, in similar ways. Yes, the functions called are named differently, but I didn't talk about absolute symmetry in characters of number of lines.
>
> In the first proposed patch both branches call its corresponding array_klass function, but only one of the legs make it explicit, and the other has that deferred to the call to allocate_xArray function. I find that this kind of asymmetry often hurts readability and makes code harder to maintain. Hence my proposal. My 2c.
Your suggested changes are really good. Thanks.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27372#discussion_r2363299629
More information about the hotspot-dev
mailing list