RFR: 8301997: Move method resolution information out of the cpCache [v6]
Martin Doerr
mdoerr at openjdk.org
Tue Oct 31 16:42:49 UTC 2023
On Mon, 30 Oct 2023 20:27:02 GMT, Matias Saavedra Silva <matsaave at openjdk.org> wrote:
>> The current structure used to store the resolution information for methods, ConstantPoolCacheEntry, is difficult to interpret due to its ambigious fields f1 and f2. This structure previously held information for fields, methods, and invokedynamic calls which were all encoded into f1 and f2. Currently this structure only handles method entries, but it remains obtuse and inconsistent with recent changes.
>>
>> This enhancement introduces a new data structure that stores the necessary resolution data in an intuitive an extensible manner. These resolved entries are stored in an array inside the constant pool cache in a very similar manner to invokedynamic entries in JDK-8301995.
>>
>> Instances of ConstantPoolCache entry related to field resolution have been replaced with the new ResolvedMethodEntry, and ConstantPoolCacheEntry has been removed entirely. The class ResolvedMethodEntry holds resolution information for all types of invoke calls besides invokedynamic, and thus has fields that may be unused depending on the invoke code.
>>
>> To streamline the review, please consider these major areas that have been changed:
>> 1. ResolvedMethodEntry class
>> 2. Rewriter for initialization of the structure
>> 3. cpCache for resolution
>> 4. InterpreterRuntime, linkResolver, and templateTable
>> 5. JVMCI
>> 6. SA
>>
>> Verified with tier 1-9 tests.
>>
>> This change supports the following platforms: x86, aarch64
>
> Matias Saavedra Silva has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 10 commits:
>
> - Merge branch 'master' into method_entry_8301997
> - Removed flag arg from prepare_invoke on aarch
> - Fixed bytecode tracer
> - Coleen and Fei comments
> - Merge branch 'master' into method_entry_8301997
> - Added asserts for getters and fixed printing
> - Removed dead code in interpreters
> - Removed unused structures, improved set_method_handle and appendix_if_resolved
> - Removed some comments and relocated code
> - 8301997: Move method resolution information out of the cpCache
I'll work on the PPC64 implementation. I have some minor suggestions regarding the aarch64 code after comparing it to x86.
src/hotspot/cpu/aarch64/templateTable_aarch64.cpp line 2374:
> 2372:
> 2373: // setup registers
> 2374: const Register index = r4;
Hardcoding is not very nice. Maybe reuse one of the other registers?
src/hotspot/cpu/aarch64/templateTable_aarch64.cpp line 2407:
> 2405: // This must be done before we get the receiver,
> 2406: // since the parameter_size includes it.
> 2407: __ push(r19);
I guess this should be `method`? See x86 version.
src/hotspot/cpu/aarch64/templateTable_aarch64.cpp line 3293:
> 3291: void TemplateTable::prepare_invoke(Register recv) {
> 3292:
> 3293: const Register cache = r2;
Passing `cache` and `flags` is better. See x86 version.
-------------
PR Review: https://git.openjdk.org/jdk/pull/15455#pullrequestreview-1706459762
PR Review Comment: https://git.openjdk.org/jdk/pull/15455#discussion_r1377707974
PR Review Comment: https://git.openjdk.org/jdk/pull/15455#discussion_r1377682342
PR Review Comment: https://git.openjdk.org/jdk/pull/15455#discussion_r1377746666
More information about the hotspot-dev
mailing list