RFR [10]: 8185362: Replace use of AtomicReferenceFieldUpdater from BufferedInputStream with Unsafe

Claes Redestad claes.redestad at oracle.com
Mon Aug 21 11:15:41 UTC 2017


On 08/21/2017 12:29 PM, Aleksey Shipilev wrote:
> On 08/21/2017 12:20 PM, Claes Redestad wrote:
>> Webrev: http://cr.openjdk.java.net/~redestad/8185362/jdk.00/
> *) Should be static *final*, otherwise you miss constant folding for Unsafe accesses:
>
>    66     private static long BUF_OFFSET = U.objectFieldOffset(BufferedInputStream.class, "buf");
>
> *) While you are at it, maybe switch to proper Java style here, e.g. "volatile byte[] buf"?
>
>    73     protected volatile byte buf[];

Done: http://cr.openjdk.java.net/~redestad/8185362/jdk.01/

/Claes



More information about the core-libs-dev mailing list