-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Refactoring the way we register classes for reflection, JNI, etc. #25975
Comments
Regarding point 2 note also that in the Native Image Committer Community Meeting 2022-06-02 it was stated that:
|
@zakkak has this now been implemented? |
I think most APIs in use by quarkus are publicly accessible ones in upcoming graal 22.3. |
No. We have indeed switched to using mostly public APIs, but we still:
Note, that there are still cases where we might not be able to avoid any of the above. But I still believe it would be good to try and minimize the generated bytecode. |
This is now fixed by:
So at this point the only non-API call we appear to still use is |
oracle/graal@4880346#diff-2f2b04e4347237de74c38065683de2f463234ce2e8e3e37b56bbc66cf2d2d068 enabled by default the "new class initialization strategy that allows all classes to be used at image build time". As a result starting with Mandrel and GraalVM 23.1 Quarkus should no longer need to explicitly set classes to be runtime reinitialized. I will prepare a patch to test this out. |
Well that took longer than expected... The conclusion is that the new class initialization doesn't really affect Quarkus since we explicitly set classes to be build time initialized and request their re-initialization explicitly when necessary. The new class initialization strategy only affects classes that are not explicitly marked for build time initialization, but happen to be build time initialized because they are dependencies of some other build time initialized class. As a result, we still need some upstream changes to fix it. |
For clarity, Quarkus would need an API version for |
Correct. |
According to oracle/graal#5013 (comment):
That means that we can just switch to the public API I think for the time being we should stick to the non-API |
Description
Quarkus currently relies on gizmo to generate a rather large
AutomaticFeature
for performing a number of things by often invoking GraalVM internal APIs instead of following the "standard" approach of generatingjson
configuration files for GraalVM to consume.Namely, Quarkus, at the time of writing, seems to rely on the following internal APIs:
com.oracle.svm.util.ReflectionUtil
com.oracle.svm.core.jni.JNIRuntimeAccess
com.oracle.svm.core.jdk.proxy.DynamicProxyRegistry
com.oracle.svm.core.jdk.LocalizationFeature
com.oracle.svm.core.jdk.localization.LocalizationFeature
com.oracle.svm.core.configure.ResourcesRegistry
com.oracle.svm.reflect.serialize.hosted.SerializationFeature
com.oracle.svm.core.jdk.serialize.SerializationRegistry
com.oracle.svm.reflect.serialize.SerializationSupport$StubForAbstractClass
com.oracle.svm.reflect.serialize.SerializationSupport
To me this approach has the following issues:
AutoFeature
. First you need to write code by using an assembler... which you then need to debug by extracting the generated by gizmo class and disassembling it to see if everything looks as expected or not.Implementation ideas
I propose we start:
AutomaticFeature
and generatingjson
files instead (which one can easily inspect and alter)WDYT?
The text was updated successfully, but these errors were encountered: