Missing folding in foreign.abi?

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Wed Nov 19 20:18:58 UTC 2025


Hi Ryan,
I believe constant folding of the data structures we need to compute 
calling sequences is probably not going to matter -- because those data 
structures are only going to be used to _build_ the downcall method handles.

Once they are built, I believe no complex access should occur. I'm sure 
Jorn can expand on this more.

That said, thanks for bringing this up -- it is always possible we 
missed something!

Cheers
Maurizio

On 19/11/2025 18:37, Ryan Hallock wrote:
> I was reviewing the recent changes in ciField.cpp and noticed that 
> `jdk.internal.foreign.abi` is not included among the special cases for 
> final fields. Is this intentional? My assumption was that you would 
> want all folding possible.
>
> I also observed that some structures such as the HashMap stored in 
> UpcallLinker.InvocationData and others like CallingSequence are using 
> mutable collections rather than immutable ones. Similarly, classes 
> such as ABIDescriptor don’t appear to apply the `@Stable` annotation 
> to their arrays, though it might require more constructs because I 
> don't believe Stable is recursive.
>
> I’m hoping this is simply an oversight and can be resolved.
>
> Cheers,
> Ryan


More information about the panama-dev mailing list