RFR(S): 8182585: [MVT] Reading an uninitialized static value type field should not throw a NPE

Roland Westrelin rwestrel at redhat.com
Tue Jun 20 16:30:14 UTC 2017


> https://bugs.openjdk.java.net/browse/JDK-8182585
> http://cr.openjdk.java.net/~thartmann/valhalla/vt_prototype/webrev.21/
>
> Static value type fields are not flattened but contain an oop to a
> Java heap allocated value type. If an uninitialized static value type
> field is read, we should not throw a NPE but return the default value
> type. I added a corresponding null check and an uncommon trap to
> handle initialization of the static field in the interpreter.
>
> This relies on the interpreter being patched as well (which is
> currently not the case).
>
> An alternative fix would be to just return the default value type (see
> also JDK-8182366). Roland, what do you think?

That looks good to me but it's unfortunate we have to add a runtime
check.

Roland.


More information about the valhalla-dev mailing list