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

Ioi Lam iklam at openjdk.org
Tue Nov 18 22:19:08 UTC 2025


On Tue, 18 Nov 2025 20:28:38 GMT, Ioi Lam <iklam 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/prims/jni.cpp line 871:
> 
>> 869:   ResourceMark rm(THREAD);
>> 870:   int size_of_parameters = method->size_of_parameters();
>> 871:   JavaCallArguments java_args(size_of_parameters);
> 
> The original code was harmless. It creates the JavaCallArguments with more space than necessary, but doesn't affect the actual number of parameters that are passed.

My previous comment is wrong. The original code is correct. `JavaCallArguments::_max_size` is number of words.  A `long` argument counts as two words.

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

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


More information about the graal-dev mailing list