Skip to content

Commit

Permalink
8262376: ReplaceCriticalClassesForSubgraphs.java fails if --with-buil…
Browse files Browse the repository at this point in the history
…d-jdk is used

Reviewed-by: dholmes, minqi, ccheung
  • Loading branch information
iklam committed Apr 29, 2021
1 parent 5ecef01 commit 2c381e0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
10 changes: 9 additions & 1 deletion src/hotspot/share/cds/heapShared.cpp
Expand Up @@ -561,7 +561,15 @@ void ArchivedKlassSubGraphInfoRecord::init(KlassSubGraphInfo* info) {
_entry_field_records = NULL;
_subgraph_object_klasses = NULL;
_is_full_module_graph = info->is_full_module_graph();
_has_non_early_klasses = info->has_non_early_klasses();

if (_is_full_module_graph) {
// Consider all classes referenced by the full module graph as early -- we will be
// allocating objects of these classes during JVMTI early phase, so they cannot
// be processed by (non-early) JVMTI ClassFileLoadHook
_has_non_early_klasses = false;
} else {
_has_non_early_klasses = info->has_non_early_klasses();
}

if (_has_non_early_klasses) {
ResourceMark rm;
Expand Down
Expand Up @@ -48,15 +48,16 @@ public static void main(String args[]) throws Throwable {

public void process(String args[]) throws Throwable {
if (args.length == 0) {
// Add an extra class to provoke JDK-8262376. This will be ignored if this class doesn't exist
// in the JDK that's being tested (e.g., if the "jdk.localedata" module is somehow missing).
String extraClasses[] = {"sun/util/resources/cldr/provider/CLDRLocaleDataMetaInfo"};

// Dump the shared archive in case it was not generated during the JDK build.
// Put the archive at separate file to avoid clashes with concurrent tests.
CDSOptions opts = new CDSOptions()
.setXShareMode("dump")
.setArchiveName(ReplaceCriticalClasses.class.getName() + ".jsa")
.setUseVersion(false)
.addSuffix("-showversion")
.addSuffix("-Xlog:cds");
CDSTestUtils.run(opts).assertNormalExit("");
.setClassList(extraClasses)
.setArchiveName(ReplaceCriticalClasses.class.getName() + ".jsa");
CDSTestUtils.createArchiveAndCheck(opts);

launchChildProcesses(getTests());
} else if (args.length == 3 && args[0].equals("child")) {
Expand Down

1 comment on commit 2c381e0

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.