RFR: 8347248: Fingerprinter::size_of_parameters() should not be used for getting number of parameters

Ioi Lam iklam at openjdk.org
Wed Nov 19 18:09:35 UTC 2025


On Wed, 19 Nov 2025 15:50:52 GMT, Matias Saavedra Silva <matsaave at openjdk.org> wrote:

>> src/hotspot/share/ci/ciMethodData.cpp line 557:
>> 
>>> 555:     mdo->set_arg_stack(_arg_stack);
>>> 556:     mdo->set_arg_returned(_arg_returned);
>>> 557:     int arg_count = mdo->method()->number_of_parameters();
>> 
>> The actual size allocated seems to be based on the argument size in slots, not count.
>> https://github.com/openjdk/jdk/blob/902aa4dcd297fef34cb302e468b030c48665ec84/src/hotspot/share/oops/methodData.cpp#L1359-L1360
>> To avoid any confusion, consider using the limit from ArgInfoData::number_of_args(), which would be better named size_of_args().
>
> So it looks like the use of "arg" here refers to "arg slot" meaning these variables and methods could be renamed to be more clear. What do you think of renaming methods like `arg_modified` to `arg_slot_modified`?

I think it's OK to rename `arg_count` to `arg_size`. There's quite a lot of existing code that does this. `arg_size` is understood to be the "number of slots". 

https://github.com/openjdk/jdk/blob/9ea8201b7494fe9107d4abd78c02ac765a5751d4/src/hotspot/share/opto/graphKit.cpp#L2365-L2366

https://github.com/openjdk/jdk/blob/9ea8201b7494fe9107d4abd78c02ac765a5751d4/src/hotspot/share/ci/bcEscapeAnalyzer.cpp#L192-L196

I am not sure about adding "slot" to "arg_modified". While there are some use of the word "slot" in the compiler APIs, it's not common.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28380#discussion_r2543024462


More information about the graal-dev mailing list