RFR: 6312651: Compiler should only use verified interface types for optimization [v2]
Roland Westrelin
roland at openjdk.org
Wed Nov 9 13:20:14 UTC 2022
On Wed, 9 Nov 2022 08:31:58 GMT, Roland Westrelin <roland at openjdk.org> wrote:
>> src/hotspot/share/ci/ciInstanceKlass.cpp line 735:
>>
>>> 733: GrowableArray<ciInstanceKlass*>* result = NULL;
>>> 734: GUARDED_VM_ENTRY(
>>> 735: InstanceKlass* ik = get_instanceKlass();
>>
>> Does it make sense to cache the result on `ciInstanceKlass` instance?
>
> Maybe but it's not as simple as it seems (for the reason discussed below for vm classes). Some classes are allocated in a special arena because they are shared between compilations. A _transitive_interfaces array would need to be allocated in that same arena (otherwise if lazily allocated during a particular compilation it would be in the thread's resource are and its content would be wiped out when the compilation is over but still reachable). That's not straightforward with the current implementation as the arena a ciInstanceKlass is allocated in is not available to the ciInstanceKlass so that would require extra changes and I'm not sure the extra complexity is worth it.
scratch that. I see it's done for `_nonstatic_fields` and will do the same.
-------------
PR: https://git.openjdk.org/jdk/pull/10901
More information about the hotspot-compiler-dev
mailing list