Request for review: 7117052 instanceKlass::_init_state can be u1 type

Jiangli Zhou jiangli.zhou at oracle.com
Fri Dec 2 10:53:02 PST 2011


Hi Tom,

Thanks for the suggestion. I changed TypeInt::BOOL to TypeInt::UBYTE in 
c2 code. The updated webrev is: 
http://cr.openjdk.java.net/~jiangli/7117052/webrev.01/.

Thanks,

Jiangli

On 12/01/2011 12:42 PM, Tom Rodriguez wrote:
> On Dec 1, 2011, at 10:51 AM, Jiangli Zhou wrote:
>
>> The instanceKlass::_init_state is defined as instanceKlass::ClassState type, which is an enum. Currently there are 7 class states defined. The instanceKlass::_init_state can be changed to u1 type, which could hold up 256 states. There are unused bytes after instanceKlass::_idnum_allocated_count field. Changing _init_state to u1 and move it to after the _idnum_allocate_count field would save 4-byte for each loaded class.
> The code in C2 to load it as T_BOOLEAN is somewhat questionable.  In particular typing the result as a TypeInt::BOOL says that it only returns 0 or 1, which is definitely not true.  It should be TypeInt::UBYTE which is the default type of a LoadUBNode.  Using T_BOOLEAN still seems a little wonky but we don't have a BasicType for unsigned byte.
>
> tom
>
>> http://cr.openjdk.java.net/~jiangli/7117052/webrev.00/
>>
>> Thanks,
>>
>> Jiangli
>>



More information about the hotspot-compiler-dev mailing list