RFR: 8367656: Refactor Constantpool's operand array into two [v7]

Serguei Spitsyn sspitsyn at openjdk.org
Wed Oct 8 20:30:31 UTC 2025


On Thu, 25 Sep 2025 12:10:52 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:

>> src/hotspot/share/oops/constantPool.hpp line 116:
>> 
>>> 114:     return _argument_count;
>>> 115:   }
>>> 116:   int argument(int n) const {
>> 
>> Q: Why was the function name changed?
>
> I think `argument_index` sounds a bit misleading, "the nth argument" makes more sense imo. Yes, I introduced the original name :-).

Why do you think the `argument_index` sounds a bit misleading? It is a CP index, is not it?
In opposite, the name `argument` is confusing. I'm suggesting to restore the function name.
Additionally, it is not easy to review relatively big refactoring, so it makes sense to avoid unnecessary renaming if possible.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27198#discussion_r2414959885


More information about the hotspot-dev mailing list