Review request 7109878: The instanceKlass EnclosingMethhod attribute fields can be folded into the _inner_class field

Jiangli Zhou jiangli.zhou at oracle.com
Tue Feb 21 10:41:50 PST 2012


The updated webrev is 
http://cr.openjdk.java.net/~jiangli/7109878/webrev.01/.

Thanks,

Jiangli

On 02/17/2012 06:02 PM, Jiangli Zhou wrote:
> Hi Dean,
>
> Thanks for catching that. Yes, it needs to be bigger than u2 since 
> "length" is already u2. I'll fix it to use int.
>
> Thanks!
>
> Jiangli
>
> On 02/17/2012 05:44 PM, Dean Long wrote:
>> In parse_classfile_inner_classes_attribute():
>>
>> !   u2 size = length * 4 + (parsed_enclosingmethod_attribute ? 2 : 0);
>>
>> don't you need a size bigger than u2 for "size"?  I think any value 
>> of "length" greater than 0x3fffffff will
>> cause an overflow.
>>
>> dl
>>
>> On 2/17/2012 3:42 PM, Jiangli Zhou wrote:
>>> Hi,
>>>
>>> Please review the changes that fold the 
>>> instanceKlass::_enclosing_method_class_index and 
>>> instanceKlass::_enclosing_method_method_index into the 
>>> instanceKlass::_inner_classes array. The 
>>> instanceKlass::_enclosing_method_class_index and 
>>> instanceKlass::_enclosing_method_method_index are only used if the 
>>> class contains the EnclosingMethod attribute (local class or 
>>> anonymous class). For majority of the classes, these two fields 
>>> (4byte total) are wasted. Folding them into the _inner_classes array 
>>> and only allocating the space for them saves 4byte for most of the 
>>> loaded classes. The enclosing method indexes are located at the end 
>>> of the _inner_classes array when exist.
>>>
>>> http://cr.openjdk.java.net/~jiangli/7109878/webrev.00/
>>>
>>> Thanks,
>>>
>>> Jiangli
>



More information about the hotspot-runtime-dev mailing list