RFR: 8301997: Move method resolution information out of the cpCache [v2]
Matias Saavedra Silva
matsaave at openjdk.org
Wed Oct 18 19:08:46 UTC 2023
On Wed, 18 Oct 2023 10:26:26 GMT, Andrew Dinn <adinn at openjdk.org> wrote:
>> Matias Saavedra Silva has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Removed some comments and relocated code
>
> src/hotspot/share/oops/cpCache.cpp line 643:
>
>> 641: oop ConstantPoolCache::appendix_if_resolved(int method_index) const {
>> 642: ResolvedMethodEntry* method_entry = resolved_method_entry_at(method_index);
>> 643: if (!method_entry->has_appendix())
>
> If you move the rest of the code in this method into the a new method `ResolvedMethodEntry::appendix_if_resolved()` then you can call that method from here and also call it in places where you have already looked up the `ResolvedMethodEntry` but are still indirecting through the cache method using an `index`.
ResolvedMethodEntry doesn't know about the constant pool or the cache, so that mean it will be unable to call `constant_pool()->resolved_reference_at(ref_index);`. Maybe an alternate solution would be to overload `appendix_if_resolved` so that it can take either `int method_index` or `ResolvedMethodEntry* method_entry` as arguments.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15455#discussion_r1364381690
More information about the hotspot-dev
mailing list