Short/Character.reverseBytes intrinsics

Ulf Zibis Ulf.Zibis at gmx.de
Wed Apr 28 03:34:53 PDT 2010


Alternatively I think, it would be more consequent to collect all bit 
mechanics in Bits.java.

Following this, Type.reverseBytes should call Bits.swap(type) instead 
contrariwise.
Additionally this would allow to place swap(float) and swap(double) in 
Bits.java.
May be the from/to raw bits mechanics code should too be better placed 
in Bits.java.

Another point:
Wouldn't the " -- Processor and memory-system properties -- " section 
better fit to Unsafe.java class ?
Anyway, the switch block in the static initializer should be proper 
indented.

-Ulf


Am 28.04.2010 00:07, schrieb Ulf Zibis:
> Am 27.04.2010 19:29, schrieb Hiroshi Yamauchi:
>> Tom,
>>
>> Thanks. It looks like it's been checked in.
>>
>>    http://hg.openjdk.java.net/jdk7/hotspot-comp/hotspot/rev/d7f654633cfe
>>
>> Now, Martin and Ulf, the following patch is up to you:
>>
>>    http://cr.openjdk.java.net/~martin/webrevs/openjdk7/nioBits.java/
>
> Looks perfect to me.
>
> Maybe you like to rename char variables to c, integers to i etc., just 
> for sugar.
>
> I'm not sure, if starting at offset 7/3/1 and then decrementing down 
> to 0 is the fastest way to step through the multi-byte values in 
> makeType and get/putTypeL/B methods. They are anyway intrinsified 
> little later. My guess is, we could save byte code and JIT 
> optimization load by defining those methods as native calls, and user 
> will not be confused, if those methods will perform slow on assembling 
> the multi-byte values from single bytes.
>
> -Ulf
>
>
>



More information about the hotspot-compiler-dev mailing list