-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support dynamic class loading and serialization
1.Dump dynamically defined classes to file system (specified by -agentlib:native-image-agent=dynmaic-class-dump-dir=) by Agent at a beforehand run and the dumped class files must be on build time's classpath to compile them into native-image. 2.Dynamically generated class's name could be decided at runtime(e.g. runtime serial number as postfix) or null when defineClass is invoked. The former is supported by using same rule to generate fixed names for both Agent runtime and native-image runtime. The latter is supported by retrieving class name from dumped class bytecode at native-image runtime. 3.Support JDK serialization/deserialization which replies on dynamic class loading and reflection. Known issue: 1.Don't support serialize proxied class, because the proxy class name differs at Agent runtime and native-image build time. 2.It is possible the jar file on classpath has a different signature file from dynamically generated class'. Current solution is to delete the signature file at native-image build time. 3.Warning message such as "WARNING: Method java.lang.Object.<clinit>() not found." will be reported at native-image build time. Because such method has been accessed via JNI calls at serialization time to calculate serializeVersionUID and the Agent has intercepted and recorded them.
- Loading branch information
Showing
20 changed files
with
1,098 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.