Consider adding verification of stable property for fields into VM.
@Stable means that all component variables of an annotated field changes value at most once.
It means that only (0/NULL) => (non-0/non-NULL) transitions are allowed for all components of a stable field.
There's a prototype implementation for template interpreter (for x86-64, primitive or reference fields are only supported): http://cr.openjdk.java.net/~vlivanov/8001107/assert.00/
@Stable means that all component variables of an annotated field changes value at most once.
It means that only (0/NULL) => (non-0/non-NULL) transitions are allowed for all components of a stable field.
There's a prototype implementation for template interpreter (for x86-64, primitive or reference fields are only supported): http://cr.openjdk.java.net/~vlivanov/8001107/assert.00/
- relates to
-
JDK-8001107 @Stable annotation for constant folding of lazily evaluated variables
- Resolved
-
JDK-8233873 final field values should be trusted as constant
- Open
-
JDK-8295486 Inconsistent constant field values observed during compilation
- Resolved