-
Notifications
You must be signed in to change notification settings - Fork 38.2k
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
Introduce PreComputeFieldFeature
based on GraalVM FieldValueTransformer
API
#29081
Comments
I have pushed a refined version of the implementation which works as expected. About the 2 issues mentioned previously:
The next step is to decide if we keep the patterns or if we introduce an annotation to identify those fields computed at build time on native and how this annotation should be named. I have mixed feelings : an annotation can easily be noticed when browsing the source code, but the fact the annotation will have an effect only on native and not on the JVM makes me wondering if that's a good idea to introduce it, at least for now. Also if introduced at Spring Framework level, Reactor won't be able to leverage it I (that said that's conceptually weak for Spring to set a Reactor field, and it could do it differently so this point is not blocking). |
Yes, that is indeed the case. But is there anything you would like to do for non-reachable fields? |
Annotations are more explicit. But there is one important thing you need to be careful with. Calling |
@christianwimmer Thanks for the update, please let me know when annotations support is available in 22.3.0-dev builds. |
Once possible, I may give it a try with We should also try to see if we can support immutable @simonbasle @violetagg That means we will likely remove Reactor field handling, I will reach you to discuss how we should handle that. |
spring-projectsgh-28506 introduces a big footprint regression on native, so it should for now be skipped when compiling to native images. Such support could potentially be re-introduced via spring-projectsgh-29081. Closes spring-projectsgh-29183
It is available now: https://github.com/oracle/graal/blob/master/sdk/src/org.graalvm.nativeimage/src/org/graalvm/nativeimage/AnnotationAccess.java |
@philwebb As discussed in latest weekly meeting, switching from pattern to annotations between RC1 and RC2 seems not possible with our release constraints. Portfolio projects are going to release against RC1 and the switch to annotations would require them to use the new annotations, test with RC2, etc. and I don't want to introduce those annotation blindly. So the best path seems to keep patterns for RCs and GA. That will also give us more time to see what GraalVM 23.x is going to provide, if we want or not leveraging it as part of Spring Framework 6.1, so there are advantages to not publish public API for now. |
This branch contains the draft commit of the new feature now names |
ConstantFieldFeature
to leverage FieldValueTransformer
PreComputeFieldFeature
based on GraalVM FieldValueTransformer
API
Current
ConstantFieldFeature
uses GraalVM internal API, requiring Java module exports and making our support pretty fragile.The new
FieldValueTransformer
API available thans to this PR in GraalVM 22.3 snapshots is designed to provide the same behavior in a more robust and maintainable way.Depends on #29080.
The text was updated successfully, but these errors were encountered: