[lworld] RFR: Unsafe primitives for values
rwestrel at redhat.com
Wed Dec 12 17:09:37 UTC 2018
> The new Unsafe APIs for values include the following:
> boolean Unsafe::isFlattened(Field f);
> boolean Unsafe::isFlattenedArray(Class<?> arrayClass);
> <V> long valueHeaderSize(Class<V> vc);
> <V> V makePrivateBuffer(V value);
> <V> V finishPrivateBuffer(V value);
> <V> V getValue(Object o, long offset, Class<?> vc);
> <V> void putValue(Object o, long offset, Class<?> vc, V v);
> makePrivateBuffer creates a value instance whose layout and
> contents is exactly the same as the input value and marks it in
> larval state and finishPrivateBuffer will exit the larval state.
> In between Unsafe.putXXX on the buffer will update the larval
> value instance.
John suggested this API some months ago but my recollection is that the
last time this was discussed (at the face to face meeting in
Burlington), John proposed going with another API (one that would work a
bit like the withfield bytecode: Unsafe.withInt() etc.). Was it decided
to not go with this one after all? Or maybe I'm misremembering?
More information about the valhalla-dev