Skip to content

JEP 401 verification with strict fields #22697

@theresa-m

Description

@theresa-m

https://cr.openjdk.org/~dlsmith/jep401/jep401-20250926/specs/value-objects-jvms.html

In a value class, a field without its ACC_STATIC flag set must have its ACC_FINAL and ACC_STRICT_INIT flags set.

if_acmpeq and if_acmpne verification:

A newly-created value object of an uninitialized type is not yet fully-formed, and if_acmpeq would improperly expose its uninitialized state. So this change disallows the use of if_acmpeq with uninitialized types.

ifnonnull verification:
From test/hotspot/jtreg/runtime/valhalla/inlinetypes/verifier/UninitializedThisVerificationTest.java, this is also expected to throw a verification error.

Like if_acmpeq, ifnonnull is useless on an uninitialized type: the value is never null, so the non-null branch will always be taken.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    TODO: VM

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions