RFR: add verifier checks for when a reference can and cannot be a value type

Karen Kinnear karen.kinnear at oracle.com
Thu May 31 21:35:58 UTC 2018


Many thanks. The changes look great.

I was wrong about expecting changes to putstatic.
From JVMS 2.4 *http://cr.openjdk.java.net/~fparain/L-world/L-World-JVMS-4d.pdf)
A value class type defines a class for which all instances are identity-less and immutable.
The class itself is not immutable.

thank you very much,

> On May 31, 2018, at 10:30 AM, Harold David Seigel <harold.seigel at oracle.com> wrote:
> Hi,
> Please review this change to add checks to the verifier for the following:
> 1. Not allow the operand for a NEW or MONITOR* opcode be a value type.
> 2. Require that the reference operand for a WITHFIELD or DEFAULTVALUE
>   opcode be a value type.
> 3. Not allow the field for a PUTFIELD opcode to be in a value type
>   unless the current method is named "<init>".
> Also, some of the existing test cases in verfierTests.jcod were modified to add the ValueTypes attribute.
> Webrev: http://cr.openjdk.java.net/~hseigel/vt_verifier_checks/webrev/index.html
> The fix was tested with JCK Lang and VM tests, Hotspot JTReg tests, and with many JDK JTReg tests.
> Thanks, Harold

More information about the valhalla-dev mailing list