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

Tobias Hartmann tobias.hartmann at oracle.com
Tue Jun 20 10:56:42 UTC 2017


Hi,

please review the following patch:
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?

Thanks,
Tobias


More information about the valhalla-dev mailing list