Skip to content

Commit

Permalink
[GR-51384] Break class initialization cycle in XML classes.
Browse files Browse the repository at this point in the history
PullRequest: graal/16760
  • Loading branch information
Christian Wimmer committed Jan 30, 2024
2 parents 7d5bccd + b78434a commit df761b6
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ public void afterRegistration(AfterRegistrationAccess access) {
rci.initializeAtBuildTime("jdk.nio", JDK_CLASS_REASON);
rci.initializeAtBuildTime("jdk.vm.ci", "Native Image classes are always initialized at build time");
rci.initializeAtBuildTime("jdk.xml", JDK_CLASS_REASON);
/*
* The XML classes have cyclic class initializer dependencies, and class initialization can
* deadlock/fail when initialization is started at the "wrong part" of the cycle.
* Force-initializing the correct class of the cycle here, in addition to the
* "whole package" initialization above, breaks the cycle because it triggers immediate
* initilalization here before the static analysis is started.
*/
rci.initializeAtBuildTime("jdk.xml.internal.JdkXmlUtils", JDK_CLASS_REASON);

rci.initializeAtBuildTime("sun.invoke", JDK_CLASS_REASON);
rci.initializeAtBuildTime("sun.launcher", JDK_CLASS_REASON);
Expand Down

0 comments on commit df761b6

Please sign in to comment.