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

Richard Reingruber rrich at openjdk.org
Mon Nov 20 17:29:40 UTC 2023


On Mon, 20 Nov 2023 15:40:10 GMT, Martin Doerr <mdoerr at openjdk.org> wrote:

> `TemplateTable::invokevfinal_helper` should use `TemplateTable::prepare_invoke`. `TemplateInterpreter::invoke_return_entry_table_for` needs to support `_fast_invokevfinal` bytecode for that which is only used by PPC64. (It is probably still beneficial for AIX which doesn't support CDS.)
> In addition, I've cleaned up some inaccurate comments.

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?

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

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


More information about the hotspot-dev mailing list