On Fri, 5 Sep 2025 16:28:39 GMT, Matias Saavedra Silva <matsa...@openjdk.org> 
wrote:

>> src/hotspot/share/cds/cdsEnumKlass.cpp line 92:
>> 
>>> 90:   }
>>> 91:   oop oop_field = mirror->obj_field(fd.offset());
>>> 92:   Klass* oop_field_klass = oop_field->is_objArray() ? 
>>> oop_field->klass()->super() : oop_field->klass();
>> 
>> Hmm, what does this do? I assume `is_objArray` tests if something can be 
>> converted to Java `Object[]`. In this case, CDS should check if the 
>> component type of the array instead of the array supepr class, I think? The 
>> original code did not call `super()`.
>
> There should be no oops that are ObjArrayKlass, so in reality this is 
> checking for refined array klasses. The reason it goes up to the super is 
> that the super will be an ObjArrayKlass, specifically the same one that will 
> be returned by `ik->array_klass_or_null()`. 
> 
> I think you're right in saying that we can look at the element klass (or 
> bottom klass?) and do the comparison as well.

Fixed.

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

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/1452#discussion_r2330296938

Reply via email to