RFR: JDK-8205549 JDK-8205698 Support of flattened values in Unsafe

Paul Sandoz paul.sandoz at oracle.com
Fri Jun 29 16:35:09 UTC 2018



> On Jun 29, 2018, at 7:14 AM, Frederic Parain <frederic.parain at oracle.com> wrote:
> 
> The legacy getObject()/putObject() would be maintained with value
> types support just the time to allow a smooth transition.
> 

IMHO i think these should be left as is. Various external (and of course unsupported!) usages of Unsafe do all sorts of crazy things and there is a risk those usages could be perturbed, either due to performance or because the new code infers something incorrectly.

I would like to suggest an alternative if this is a major concern. Modify the sun.misc.Unsafe implementation in the unsupported module and add asserts to the Java implementations to fail if it is detected value types are used. Then document the restrictions.

Paul.


More information about the valhalla-dev mailing list