RFR: 8320418: PPC64: invokevfinal_helper duplicates code to handle ResolvedMethodEntry

Richard Reingruber rrich at openjdk.org
Tue Nov 21 08:27:07 UTC 2023


On Mon, 20 Nov 2023 19:48:26 GMT, Martin Doerr <mdoerr at openjdk.org> wrote:

>> src/hotspot/cpu/ppc/templateTable_ppc_64.cpp line 3536:
>> 
>>> 3534:            Rrecv       = Rscratch2;
>>> 3535:   __ ld(Rnum_params, in_bytes(Method::const_offset()), Rmethod);
>>> 3536:   __ lhz(Rnum_params /* number of params */, in_bytes(ConstMethod::size_of_parameters_offset()), Rnum_params);
>> 
>> [`ConstMethod::_size_of_parameters`](https://github.com/openjdk/jdk/blob/0712b22a3ae7075304e5925365429e1d85bd173c/src/hotspot/share/oops/constMethod.hpp#L208) is the size of the parameter block in words. `prepare_invoke` uses `ResolvedMethodEntry::_number_of_parameters` which is `Number of arguments for method`. I'd expect the location of the receiver to depend on the size of the parameters and not their number. How does this work?
>
> One is a copy of the other. See usages of `method_entry->fill_in` in src/hotspot/share/oops/cpCache.cpp. E.g.
> `method_entry->fill_in((u1)as_TosState(method->result_type()), (u2)method()->size_of_parameters());`
> Scaling happens in `load_receiver`.

Thanks for looking it up for me :)
So `ResolvedMethodEntry::_number_of_parameters` is a misnomer or am I missing something?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16741#discussion_r1400184083


More information about the hotspot-dev mailing list