Interaction between Panama and Valhalla
Glavo
zjx001202 at gmail.com
Wed Mar 2 03:55:29 UTC 2022
Can someone answer my question? Many thanks.
On Thu, Jan 27, 2022 at 12:50 AM Glavo <zjx001202 at gmail.com> wrote:
> I noticed that some Panama features seem to benefit from Valhalla's
> features. A notable example is MemoryAddress, which has been marked as
> value based and should be able to migrate to value classes in the future.
>
> However, this is not enough to satisfy me. MemoryAddress can be more than
> just a value class (identity-free reference type), but also a perfect
> candidate for the primitive class (JEP 401).
> It would be perfect if it could become a primitive class: Eliminates the
> possibility that Java's `null` being its value, we just need
> `MemoryAddress.NULL`;
> Such a small primitive class should almost always be flattened, storing it
> in a field or array is as simple as a long
> (According to the description of JEP draft 8280173, when value class is
> stored in arrays and fields, it may not be flattened, and additional
> objects still need to be created)...
>
> However, what worries me is that the current Valhalla prototype does not
> seem to provide a way to migrate a class to a primitive class while
> maintaining compatibility.
> I'm worried that if Panama can't make it a primitive class before ending
> the preview, it will become a permanent regret.
> I don't know whether the two JDK preview functions can interact with each
> other, so here I want to ask if it is possible for Panama to have closer
> contact with Valhalla when Valhalla starts previewing at the same time?
>
More information about the panama-dev
mailing list