[lworld] RFR: 8321039: [lworld] Substitutability code must recognize new annotations
    Chen Liang 
    liach at openjdk.org
       
    Wed Dec  6 02:41:04 UTC 2023
    
    
  
On Tue, 5 Dec 2023 19:57:56 GMT, Mandy Chung <mchung at openjdk.org> wrote:
> An initial implementation for substitutability test and partial method handle and var handle support for null-restricted types. JDK-8317767 will provide the full library support for null-restricted types.    
> 
> This patch handles null-restricted field reference declared in a non-flat class.  The default value of that field is lazily set by VM on read access.  `Unsafe::getReference` may return null for null-restricted non-flat field.  
> 
> A new `jdk.internal.value.ValueClass` is created to provide JVM entry points for value classes until public APIs are defined.     `jdk.internal.misc.newNullRestrictedArray` method is moved as well.
src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java line 689:
> 687:                                                       boolean isValue, boolean isFlat, boolean isNullRestricted, Class<?> ftype) {
> 688:         int ftypeKind = ftypeKind(ftype, isValue);
> 689:         int afIndex = afIndex(formOp, isVolatile, isFlat, ftypeKind);
The null-restriction info should be encoded in the cache key too.
src/java.base/share/classes/java/lang/invoke/X-VarHandle.java.template line 53:
> 51: #end[Reference]
> 52: 
> 53:         FieldInstanceReadOnly(Class<?> receiverType, long fieldOffset{#if[Object]?, Class<?> fieldType, boolean nullRestricted}) {
This `nullRestricted` can be conditional to references, too
-------------
PR Review Comment: https://git.openjdk.org/valhalla/pull/960#discussion_r1416580334
PR Review Comment: https://git.openjdk.org/valhalla/pull/960#discussion_r1416581498
    
    
More information about the valhalla-dev
mailing list