Feedback / query on jextract for Windows 10
john.r.rose at oracle.com
Mon Feb 1 04:35:06 UTC 2021
On Jan 28, 2021, at 2:05 PM, Maurizio Cimadamore <maurizio.cimadamore at oracle.com> wrote:
> This approach is fully lazy: the `x` constant is only initialized when
> the `get_x` method is called, because the constant is defined in its
> own holder class, and that holder class is only referenced by the
> getter method. So this is both lazy, and constant-friendly.
This is one of the use cases for lazy statics. IMO a compelling
compilation story would be a new mechanism for tying a
static final to a condy CP entry, sort of like they are tied to
CONSTANT_String and CONSTANT_Integer CP entries today.
But these changes are always expensive and difficult.
In the case of lazies, we would want to upgrade the JVM
and the language in tandem. And we’d want to put in a
story for lazy non-statics, which is a can of worms.
One limited way to begin could be to add just the JVM
feature, just for statics, so that bytecode generator tools
could use it. That’s the thrust of JDK-8209964.
A risk there is that what we would build would be
not-quite-right for an eventual build-out through
More information about the panama-dev