< prev index next >
src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java
Print this page
rev 57943 : 8237878: Improve ModuleLoaderMap datastructures
Reviewed-by: alanb
*** 381,391 ****
// loader.
long t5 = System.nanoTime();
// mapping of modules to class loaders
! Function<String, ClassLoader> clf = ModuleLoaderMap.mappingFunction(cf);
// check that all modules to be mapped to the boot loader will be
// loaded from the runtime image
if (haveModulePath) {
for (ResolvedModule resolvedModule : cf.modules()) {
--- 381,396 ----
// loader.
long t5 = System.nanoTime();
// mapping of modules to class loaders
! ModuleLoaderMap.Mapper clf;
! if (archivedModuleGraph != null) {
! clf = archivedModuleGraph.classLoaderFunction();
! } else {
! clf = ModuleLoaderMap.mappingFunction(cf);
! }
// check that all modules to be mapped to the boot loader will be
// loaded from the runtime image
if (haveModulePath) {
for (ResolvedModule resolvedModule : cf.modules()) {
*** 456,472 ****
}
// Module graph can be archived at CDS dump time. Only allow the
// unnamed module case for now.
if (canArchive && (mainModule == null)) {
! ArchivedModuleGraph.archive(mainModule,
! hasSplitPackages,
hasIncubatorModules,
systemModuleFinder,
cf,
concealedPackagesToOpen,
! exportedPackagesToOpen);
}
// total time to initialize
Counters.add("jdk.module.boot.totalTime", t0);
Counters.publish();
--- 461,478 ----
}
// Module graph can be archived at CDS dump time. Only allow the
// unnamed module case for now.
if (canArchive && (mainModule == null)) {
! ArchivedModuleGraph.archive(
! new ArchivedModuleGraph(hasSplitPackages,
hasIncubatorModules,
systemModuleFinder,
cf,
+ clf,
concealedPackagesToOpen,
! exportedPackagesToOpen));
}
// total time to initialize
Counters.add("jdk.module.boot.totalTime", t0);
Counters.publish();
*** 754,764 ****
Modules.addOpens(m, pn, other);
} else {
Modules.addExports(m, pn, other);
}
}
-
}
}
}
/**
--- 760,769 ----
< prev index next >