Value array flattening in L-world
john.r.rose at oracle.com
Fri Feb 23 01:35:31 UTC 2018
On Feb 22, 2018, at 9:29 AM, Remi Forax <forax at univ-mlv.fr> wrote:
> One solution is to consider that doesn't mean literally null like Object doesn't mean ref anymore.
> In that case, null means default value and remove() and isEmpty() works.
> If we go with this semantics, we may also have to revisit the semantics of putfield with null.
This is the semantics given by MethodHandles.explicitCastArguments,
when (say) an Object reference that is null must be cast to (say) an int.
It is useful sometimes, but mapping nulls to other default values is a
long slippery slope that I'm afraid of. It feels safer to take our NPEs
and treat them as bugs, rather than paper over them by substituting
other values. Also, code which throws on corner cases can be more
easily optimized than code which does ad hoc value fixups.
More information about the valhalla-dev