RFR: 8347248: Fingerprinter::size_of_parameters() should not be used for getting number of parameters
Dean Long
dlong at openjdk.org
Wed Nov 19 00:47:18 UTC 2025
On Tue, 18 Nov 2025 20:12:20 GMT, Matias Saavedra Silva <matsaave 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().
src/hotspot/share/prims/whitebox.cpp line 1272:
> 1270: mdo->init();
> 1271: ResourceMark rm(THREAD);
> 1272: int arg_count = mdo->method()->number_of_parameters();
See my comment for ciMethodData::update_escape_info(). Same issue.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28380#discussion_r2540064259
PR Review Comment: https://git.openjdk.org/jdk/pull/28380#discussion_r2540067055
More information about the graal-dev
mailing list