Unsafe.getValue() on a flattenable but non flattened field
Mandy Chung
mandy.chung at oracle.com
Thu Dec 6 15:49:48 UTC 2018
Yes, the user of `Unsafe` is responsible for asking whether a given
variable is flattened or not.
MemberName::isFlatValue is the API to determine if this member is
flattened. Similarly, the modifier of java.lang.reflect.Field
carries a bit to indicate if flattened. I'm considering adding
Unsafe::isFlattened(Field).
Mandy
On 12/6/18 6:50 AM, Roland Westrelin wrote:
> I see Unsafe.getValue() fails on a non flattened field with an
> assert. Given it's entirely up to the VM to flatten or not flattenable
> fields, how would a user know whether it can call getValue()? Wouldn't
> he need an API call to check if a field is actually flattened or not? Or
> am I missing something?
>
> Roland.
More information about the valhalla-dev
mailing list