mengnankkkk commented on code in PR #2701:
URL: https://github.com/apache/fory/pull/2701#discussion_r2412546990


##########
java/fory-core/src/main/resources/META-INF/native-image/org.apache.fory/fory-core/reflection-config.json:
##########
@@ -5,5 +5,18 @@
     "allPublicConstructors": true,
     "allDeclaredMethods": true,
     "allPublicMethods": true
+  },
+  {
+    "name": "jdk.internal.reflect.ReflectionFactory",

Review Comment:
   > those methods are executed at graalvm build time, they won't be executed 
at graalvm runtime. It's unnecessary to add reflection-config.
   > 
   > I think the key is find out why the generated constructor don't work
   I found the problem:
   When GraalVM's AOT compiler attempts to statically compile this "handle" 
into native code, the constructor in the final executable file is actually 
corrupted and unusable because the dynamic JVM mechanism behind it does not 
exist in GraalVM's minimalist runtime (Substrate VM).
   I think it's possible to use the Unsafe downgrade solution exclusively in 
GraalVM Native Images. Please share your understanding and solution with me, 
and I'll consider it.



##########
java/fory-core/src/main/resources/META-INF/native-image/org.apache.fory/fory-core/reflection-config.json:
##########
@@ -5,5 +5,18 @@
     "allPublicConstructors": true,
     "allDeclaredMethods": true,
     "allPublicMethods": true
+  },
+  {
+    "name": "jdk.internal.reflect.ReflectionFactory",

Review Comment:
   > those methods are executed at graalvm build time, they won't be executed 
at graalvm runtime. It's unnecessary to add reflection-config.
   > 
   > I think the key is find out why the generated constructor don't work
   
   
   
   I found the problem:
   When GraalVM's AOT compiler attempts to statically compile this "handle" 
into native code, the constructor in the final executable file is actually 
corrupted and unusable because the dynamic JVM mechanism behind it does not 
exist in GraalVM's minimalist runtime (Substrate VM).
   I think it's possible to use the Unsafe downgrade solution exclusively in 
GraalVM Native Images. Please share your understanding and solution with me, 
and I'll consider it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to