Interaction between Panama and Valhalla

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Wed Mar 2 15:26:52 UTC 2022


This has been replied to in panama-dev:

https://mail.openjdk.java.net/pipermail/panama-dev/2022-March/016458.html

Cheers
Maurizio

On 02/03/2022 06:09, fazil mohamed wrote:
> Hi Developers
>
> Can anyone put some lights on Glavo's concerns. Although these features are
> under incubation/preview, JVMs inspired from OpenJDK are extremely focused
> on these JEPs and projects. In the near future the expectation is to define
> a method or variable using the Vector API(JEP-417) wrapper and can hold any
> primitive value type from Project Valhalla. Using project Panama memory
> layout, the developer can specify the size(32/64) and memory address within
> the heap of the defined. This reduces the GC time to Mark and Evacuate the
> space. These are all Hypothetical Thinking correct me if I'm wrong.
>
> On Wed, Mar 2, 2022 at 9:27 AM Glavo <zjx001202 at gmail.com> wrote:
>
>> 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 jdk-dev mailing list