On Tue, 21 Apr 2026 09:44:13 GMT, Tobias Hartmann <[email protected]> wrote:

>> src/hotspot/share/opto/type.cpp line 7333:
>> 
>>> 7331: 
>>> 7332: 
>>> //------------------------------make-------------------------------------------
>>> 7333: const TypeFunc* TypeFunc::make(ciMethod* method, bool is_call, bool 
>>> is_osr_compilation) {
>> 
>> It is better to have a description for the meaning of `is_call`.
>
> I added a comment explaining the purpose of this method and its arguments.

Thanks, I understand it now.

>> src/hotspot/share/runtime/sharedRuntime.cpp line 2918:
>> 
>>> 2916:     for (SignatureStream ss(_method->signature()); 
>>> !ss.at_return_type(); ss.next()) {
>>> 2917:       BasicType bt = ss.type();
>>> 2918:       if (InlineTypePassFieldsAsArgs && bt == T_OBJECT) {
>> 
>> Similarly, this can also be removed.
>
> I added this to address a comment that @fparain had when reading this code:
>> [...] a point that was bothering me was that `InlineTypePassFieldsAsArgs` is 
>> tested after the call to ss.as_inline_klass(), this is not obvious when 
>> reading the code above but the test is performed in 
>> vk->can_be_passed_as_fields() (this is the only thing this method tests) 
>> which is called after having poke the system dictionary."
> 
> The expensive part here is `ss.as_inline_klass()`, so we definitely want to 
> guard this by `InlineTypePassFieldsAsArgs` but since that method is also 
> called from other places when `!InlineTypePassFieldsAsArgs && 
> InlineTypeReturnedAsFields`, we can't easily move that check into the method. 
> Also, as Fred mentions, it's easier to read when the check is in the caller.
> 
> What do you think?

I see, in that case keeping `InlineTypePassFieldsAsArgs` in the caller is more 
preferable then.

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

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2339#discussion_r3116734414
PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2339#discussion_r3116739197

Reply via email to