Helpers for MethodHandles.byteArrayViewVarHandle VarHandle

Jaroslav Kameník jaroslav at kamenik.cz
Thu May 19 14:26:36 UTC 2016


>
>
> There certainly is in nio buffer sources (and may be for encoding/decoding
> in other areas, i am speculating as i have not looked), but for buffer
> sources we can actually remove much if not all of Bits.java via use of the
> internal Unsafe unaligned accessors.
>

 I made some notes when I was looking at it, I am attaching it if you want
look at it.

> getLongFrom[LE/BE](byte[] data, int firstByteIndex)
>             - for direct access
> > getLongFrom[LE/BE](byte[] data, int firstByteOffset, int
> longArrayIndex)     - for loops/shifted array access
> >
> > etc.
>
> I was proposing just the latter, and just for VarHandles :-) it’s not just
> for loops but also to bring alignment issues to the foreground. (It also it
> fits in with something we have been pondering about for the unsafe
> unaligned accessors on systems that don’t support unaligned access, such as
> SPARC).
>

What do you mean by 'just for VarHandles'? Add it between VarHandle
methods?


Jaroslav



More information about the core-libs-dev mailing list