RFR: 6312651: Compiler should only use verified interface types for optimization [v3]
Vladimir Ivanov
vlivanov at openjdk.org
Fri Nov 11 00:04:39 UTC 2022
On Thu, 10 Nov 2022 08:39:38 GMT, Roland Westrelin <roland at openjdk.org> wrote:
>> src/hotspot/share/ci/ciArrayKlass.cpp line 108:
>>
>>> 106: }
>>> 107:
>>> 108: GrowableArray<ciInstanceKlass*>* ciArrayKlass::interfaces() {
>>
>> FTR there's a subtle asymmetry between `ciArrayKlass::interfaces()` and `ciInstanceKlass::transitive_interfaces()` when it comes to memory allocation: the former allocates from resource area while the latter from compiler arena.
>>
>> It doesn't cause any problems since `ciArrayKlass::interfaces()` is used only in `Type::Initialize_shared()` to instantiate shared `TypeAryPtr::_array_interfaces`, but it took me some time to find that out.
>>
>> Maybe a helper method in `type.cpp` is a better place for that logic.
>
> How would that work? ciArrayKlass::interfaces() has to transition into the vm which is not something that would feel right in type.cpp.
Indeed, good point.
IMO you could just work directly with CI mirrors for `Serializable` and `Cloneable`, but now I'm curious why does CI code diverge from `ObjArrayKlass::compute_secondary_supers()`?
https://github.com/openjdk/jdk/blob/master/src/hotspot/share/oops/objArrayKlass.cpp#L376
-------------
PR: https://git.openjdk.org/jdk/pull/10901
More information about the hotspot-compiler-dev
mailing list