Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate JEP 502: Stable Values (Preview) #22454

Open
He-Pin opened this issue Jan 24, 2025 · 2 comments
Open

Investigate JEP 502: Stable Values (Preview) #22454

He-Pin opened this issue Jan 24, 2025 · 2 comments
Labels
area:jdk Issues tied to artifacts published under a particular jdk compat:java:jep:unstable Issues corresponding to a JEP (JDK Enhancement Proposal) which is not stable yet. compat:java:jep Issues corresponding to a JEP (JDK Enhancement Proposal) itype:enhancement

Comments

@He-Pin
Copy link

He-Pin commented Jan 24, 2025

https://openjdk.org/jeps/502
Which may help for lazy val

@liach
Copy link

liach commented Jan 24, 2025

I think for scala3, a StableValue can replace the field holding the actual value. The translation strategy needs an update so that if a value is present, no query is made to the mutable bitmap/flags field. This is required for JIT compilers to constant fold such an initialized value.

@sjrd
Copy link
Member

sjrd commented Jan 24, 2025

That API does seem to fit the semantics of lazy vals. However, it's currently only in Preview for Java 24/25. Judging by our last few JDK support windows, we won't be able to use this for another 5 years at the very least. I don't think this is worth tracking.

@Gedochao Gedochao added itype:enhancement area:jdk Issues tied to artifacts published under a particular jdk compat:java:jep Issues corresponding to a JEP (JDK Enhancement Proposal) compat:java:jep:unstable Issues corresponding to a JEP (JDK Enhancement Proposal) which is not stable yet. labels Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:jdk Issues tied to artifacts published under a particular jdk compat:java:jep:unstable Issues corresponding to a JEP (JDK Enhancement Proposal) which is not stable yet. compat:java:jep Issues corresponding to a JEP (JDK Enhancement Proposal) itype:enhancement
Projects
None yet
Development

No branches or pull requests

4 participants