Request for reviews (S): 6987555: JSR 292 unboxing to a boolean value fails on big-endian SPARC

Tom Rodriguez tom.rodriguez at oracle.com
Tue Sep 28 14:04:35 PDT 2010


On Sep 28, 2010, at 12:58 PM, John Rose wrote:

> On Sep 27, 2010, at 4:43 AM, Christian Thalinger wrote:
> 
>> http://cr.openjdk.java.net/~twisti/6987555/webrev.01/
>> 
>> 6987555: JSR 292 unboxing to a boolean value fails on big-endian SPARC
>> Reviewed-by: 
> 
> There is an and3/cmp which uses the same value for both mask and test pattern.
> 
> It happens to work, but I think you should use this value for the mask:
>  (CONV_VMINFO_MASK << CONV_VMINFO_SHIFT)
> 
> Also, the value BitsPerByte-1 looks pretty magic.  For the sake of future readers, I suggest something more explicit:
>  int old_shift = (boolean_shift & (BitsPerInt-1));
>  int new_shift = (BitsPerInt - BitsPerByte);  // 0x01000000 => 0x00000001
>  __ delayed()->xor3(vminfo, old_shift ^ new_shift, vminfo);

That doesn't seem clearer to me.  If the shift should be 24 then why isn't that the value in vminfo in the first place?

That whole section of code is mysterious in terms of what cases it's actually supposed to handle and how.  I've exchanged a bit of email with Christian about it and I think he's working on some tests to exercise these conversions more.  What are the possible input and output types?  Is it only the direct mappings between the boxed and unboxed forms, like Integer -> int, or can it do arbitrary conversions like Short -> byte?

tom

> 
> -- John



More information about the hotspot-compiler-dev mailing list