JDK-8317277 - Java language implementation of value classes and objects

Remi Forax forax at univ-mlv.fr
Wed Oct 18 20:59:34 UTC 2023


> From: "Archie Cobbs" <archie.cobbs at gmail.com>
> To: "valhalla-dev" <valhalla-dev at openjdk.org>
> Sent: Wednesday, October 18, 2023 9:12:21 PM
> Subject: JDK-8317277 - Java language implementation of value classes and objects

... 

> Also, I have a couple of totally unrelated questions about value classes...

> 1. If v is a value object, what does System.identityHashCode(v) return?

A combination of some field values of the object. 
It has to be fast so the VM should not use all fields if there are a lot of them or if some values are value class (or field type that can potentially store value class) because it will make the computation recursive. 

> 2. If V is a value class, is {Weak,Soft,Phantom}Reference<V> supported?

Nope. There is maybe no address/no pointer so no weak reference. 

> -Archie

> --
> Archie L. Cobbs

regards, 
Rémi 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/valhalla-dev/attachments/20231018/57d0cae4/attachment.htm>


More information about the valhalla-dev mailing list