RFR: 8301997: Move method resolution information out of the cpCache [v10]
Martin Doerr
mdoerr at openjdk.org
Fri Nov 10 09:31:19 UTC 2023
On Thu, 9 Nov 2023 22:48:59 GMT, Matias Saavedra Silva <matsaave at openjdk.org> wrote:
>> Matias Saavedra Silva has updated the pull request incrementally with two additional commits since the last revision:
>>
>> - PPC port
>> - Improved load_resolved_method_entry_handle on x86 and aarch64
>
>> I have a version which works for PPC64: [TheRealMDoerr at 6bff392](https://github.com/TheRealMDoerr/jdk/commit/6bff39224e3129a898711a392b64c38b331d79a2)
>>
>> Note that I have implemented a few things slightly differently:
>>
>> * `TemplateTable::load_resolved_method_entry_handle`: I'm loading the method at the end which avoids pushing and popping it on the expression stack which is not so nice IMHO. This works because I'm using a non-volatile register (asserted) for `cache` which is still valid after the C-call in `resolve_oop_handle`.
>>
>> * `TemplateTable::load_resolved_method_entry_interface` and `TemplateTable::load_resolved_method_entry_virtual`: I'm not putting values in registers depending on the flags because it doesn't fit nicely into the PPC64 design. I found myself scratching my head and thinking about what is in the register in which case. Instead of that, I'm loading the fields where they are needed which leads to a much cleaner design. I always know what is in which register this way.
>>
>>
>> Please take a look and take these differences into consideration for other platforms. Thanks!
>
> Thank you for the port! I liked your recommendation with regards to invokehandle and added that change to x86 and aarch64 as well.
> Hi @matias9927 : This change [1] for aarch64 and x86 looks nice and I am trying to prepare a similar one for riscv. But I have a small question regarding this change. I see we are using `r2` for `cache` on aarch64 which is a volatile (or caller-saved) register according to the ABI. So the value in `cache` won't be preserved accross the C-call in resolve_oop_handle. Will this work? Is there anything I missed? Thanks.
>
> [1] [7d2a20c](https://github.com/openjdk/jdk/commit/7d2a20ccf63f6140f7ba96904af2e3d89c6ab370)
Please note that I'm using `assert(cache->is_nonvolatile(), "C-call in resolve_oop_handle");` on PPC64 which makes it reliable.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/15455#issuecomment-1805376992
More information about the hotspot-dev
mailing list