[graalvm-dev] A PR to support dynamic class loading and class serialization/deserialization in SubstrateVM

Christian Wimmer christian.wimmer at oracle.com
Wed Apr 8 09:17:05 PDT 2020


Hi,

Thanks for your contribution! We will have a detailed look at the source 
code and provide comments directly on the GitHub PR.

-Christian


On 4/7/20 05:45, 林子熠(层风) wrote:
> Dear all,
> 
> We have committed a PR to support dynamic class loading and class 
> serialization/deserialization in SubstrateVM.
> 
> https://github.com/oracle/graal/pull/2323 
> <https://urldefense.com/v3/__https://github.com/oracle/graal/pull/2323__;!!GqivPVa7Brio!I9JJfIe3JyijYwHeZxP1gfgmWYa6h2H6FoD6rGzqiOGK40VXyMOYIMfamEmtMVLLXT6n9A$>
> 
> The basic idea for supporting dynamic class loading is dumping classes 
> generated at run time in a beforehand run with native-image-agent to a 
> specified directory which is added to the classpath to build 
> native-image. Serialization/deserialization is basically dynamic class 
> loading + reflection.
> This is implemented in 3 steps:
> 
>  1. Intercept java.lang.ClassLoader.postDefineClass and
>     sun.reflect.ClassDefiner.defineClass by native-image-agent to dump
>     the dynamically generated class to file system.
>  2. Make sure the generated classes' names are fixed through Hotspot
>     version runtime and native-image version runtime.
>  3. Substitute relevant classes in SubstrateVM to load the previously
>     dumped classes.
> 
> More details can be found the PR.
> 
> Ziyi Lin
> 
> 
> _______________________________________________
> GraalVM-Dev mailing list
> GraalVM-Dev at oss.oracle.com
> https://oss.oracle.com/mailman/listinfo/graalvm-dev
> 



More information about the GraalVM-Dev mailing list