RFR (T) 8242898: Clean up InstanceKlass::_array_klasses

Ioi Lam ioi.lam at oracle.com
Wed Apr 29 16:15:31 UTC 2020


Hi Coleen,

This looks good, but should we also rename array_klasses to array_klass, 
since in most cases we are talking about one klass instead of many klasses?

The plural makes sense only in places like this:


1625 void InstanceKlass::array_klasses_do(void f(Klass* k, TRAPS), TRAPS) {
1626   if (array_klass() != NULL)
1627     array_klass()->array_klasses_do(f, THREAD);
1628 }

Thanks
- Ioi


On 4/29/20 6:06 AM, coleen.phillimore at oracle.com wrote:
>
>
> On 4/29/20 8:44 AM, David Holmes wrote:
>> Hi Coleen,
>>
>> On 29/04/2020 10:11 pm, coleen.phillimore at oracle.com wrote:
>>> Summary: Use more specific ObjArrayKlass type.
>>>
>>> This avoids some casts.  Tested with tier1-3.
>>>
>>> open webrev at 
>>> http://cr.openjdk.java.net/~coleenp/2020/8242898.01/webrev
>>> bug link https://bugs.openjdk.java.net/browse/JDK-8242898
>>
>> This looks fine to me.
>>
>> I have to wonder why this was not defined this way all along?
>
> It was likely klassOop and stayed that way until Ioi noticed.
> Thanks,
> Coleen
>>
>> Thanks,
>> David
>>
>>> thanks,
>>> Coleen
>



More information about the hotspot-runtime-dev mailing list