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

Matias Saavedra Silva matsaave at openjdk.org
Wed Nov 19 15:53:23 UTC 2025


On Wed, 19 Nov 2025 00:42:54 GMT, Dean Long <dlong at openjdk.org> wrote:

>> The method size_of_parameters() is sometimes used as if it represents the number of arguments rather than the size in bytes of the arguments. This patch changes some of these instances to the correct result or renames some of the variables to the desired result. Verified with tier 1-5 tests.
>
> 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`?

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

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


More information about the graal-dev mailing list