<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=gb2312"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:宋体;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:等线;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"Segoe UI";
        panose-1:2 11 5 2 4 2 4 2 2 3;}
@font-face
        {font-family:"\@宋体";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"\@等线";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        text-align:justify;
        text-justify:inter-ideograph;
        font-size:10.5pt;
        font-family:等线;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:宋体;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:等线;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:等线;}
/* Page Definitions */
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:138307707;
        mso-list-template-ids:-231452786;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=ZH-CN link="#0563C1" vlink="#954F72" style='text-justify-trim:punctuation'><div class=WordSection1><p class=MsoNormal><span lang=EN-US>Dear all,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>We have committed a PR to support dynamic class loading and class serialization/deserialization in SubstrateVM.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><a href="https://urldefense.com/v3/__https://github.com/oracle/graal/pull/2323__;!!GqivPVa7Brio!I9JJfIe3JyijYwHeZxP1gfgmWYa6h2H6FoD6rGzqiOGK40VXyMOYIMfamEmtMVLLXT6n9A$">https://github.com/oracle/graal/pull/2323</a><o:p></o:p></span></p><p class=MsoNormal align=left style='margin-bottom:12.0pt;text-align:left'><span lang=EN-US style='font-family:"Segoe UI",sans-serif;color:#24292E'>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.<br>This is implemented in 3 steps:<o:p></o:p></span></p><ol start=1 type=1><li class=MsoNormal style='color:#24292E;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-align:left;mso-list:l0 level1 lfo1'><span lang=EN-US style='font-family:"Segoe UI",sans-serif'>Intercept java.lang.ClassLoader.postDefineClass and sun.reflect.ClassDefiner.defineClass by native-image-agent to dump the dynamically generated class to file system.<o:p></o:p></span></li><li class=MsoNormal style='color:#24292E;margin-top:2.65pt;mso-margin-bottom-alt:auto;text-align:left;mso-list:l0 level1 lfo1'><span lang=EN-US style='font-family:"Segoe UI",sans-serif'>Make sure the generated classes' names are fixed through Hotspot version runtime and native-image version runtime.<o:p></o:p></span></li><li class=MsoNormal style='color:#24292E;margin-top:2.65pt;mso-margin-bottom-alt:auto;text-align:left;mso-list:l0 level1 lfo1'><span lang=EN-US style='font-family:"Segoe UI",sans-serif'>Substitute relevant classes in SubstrateVM to load the previously dumped classes.<o:p></o:p></span></li></ol><p class=MsoNormal><span lang=EN-US>More details can be found the PR.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US>Ziyi Lin<o:p></o:p></span></p></div></body></html>