RFR: 6312651: Compiler should only use verified interface types for optimization [v2]

Roland Westrelin roland at openjdk.org
Tue Nov 8 15:34:37 UTC 2022


On Mon, 7 Nov 2022 23:51:44 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:

> BTW will there still be a need in `CastPP` vs `CheckCastPP` dichotomy once the patch goes in?

In principle, probably not.

> src/hotspot/share/ci/ciObjectFactory.cpp line 160:
> 
>> 158:     InstanceKlass* ik = vmClasses::name();                           \
>> 159:     ciEnv::_##name = get_metadata(ik)->as_instance_klass();          \
>> 160:     Array<InstanceKlass*>* interfaces = ik->transitive_interfaces(); \
> 
> What's the purpose of interface-related part of the code?

ciInstanceKlass objects for the vm classes all need to be allocated from the same long lived arena that's created in ciObjectFactory::initialize() because they are shared between compilations. Without that code, the ciInstanceKlass for a particular vm class is in the long lived arena but the ciInstanceKlass objects for the interfaces are created later when they are needed in the arena of some compilation. Once that compilation is over the interface objects are destroyed but still referenced from shared types such as TypeInstPtr::MIRROR.

-------------

PR: https://git.openjdk.org/jdk/pull/10901


More information about the hotspot-compiler-dev mailing list