author | ccheung |
Mon, 29 Oct 2018 13:58:29 -0700 | |
changeset 52320 | 26777794ade5 |
parent 51688 | fd3b632801aa |
permissions | -rw-r--r-- |
50951
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
1 |
/* |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
2 |
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
4 |
* |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
8 |
* |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
13 |
* accompanied this code). |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
14 |
* |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
18 |
* |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
21 |
* questions. |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
22 |
* |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
23 |
*/ |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
24 |
|
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
25 |
import java.io.File; |
51371
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
26 |
import java.lang.module.Configuration; |
50951
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
27 |
import java.lang.module.ModuleDescriptor; |
51371
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
28 |
import java.util.List; |
50951
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
29 |
import java.util.Set; |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
30 |
import sun.hotspot.WhiteBox; |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
31 |
|
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
32 |
// |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
33 |
// Test archived system module graph when open archive heap objects are mapped: |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
34 |
// |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
35 |
public class CheckArchivedModuleApp { |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
36 |
static WhiteBox wb; |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
37 |
public static void main(String args[]) throws Exception { |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
38 |
wb = WhiteBox.getWhiteBox(); |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
39 |
|
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
40 |
if (!wb.areOpenArchiveHeapObjectsMapped()) { |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
41 |
System.out.println("Archived open_archive_heap objects are not mapped."); |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
42 |
System.out.println("This may happen during normal operation. Test Skipped."); |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
43 |
return; |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
44 |
} |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
45 |
|
51371
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
46 |
if (args.length != 2) { |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
47 |
throw new RuntimeException( |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
48 |
"FAILED. Incorrect argument length: " + args.length); |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
49 |
} |
51688
fd3b632801aa
8210515: [TESTBUG]CheckArchivedModuleApp.java needs to check if EnableJVMCI is set.
jiangli
parents:
51371
diff
changeset
|
50 |
|
51371
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
51 |
boolean expectArchivedDescriptors = "yes".equals(args[0]); |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
52 |
boolean expectArchivedConfiguration = "yes".equals(args[1]); |
51688
fd3b632801aa
8210515: [TESTBUG]CheckArchivedModuleApp.java needs to check if EnableJVMCI is set.
jiangli
parents:
51371
diff
changeset
|
53 |
// -XX:+EnableJVMCI adds extra system modules, in which case the system |
fd3b632801aa
8210515: [TESTBUG]CheckArchivedModuleApp.java needs to check if EnableJVMCI is set.
jiangli
parents:
51371
diff
changeset
|
54 |
// module objects are not archived. |
52320
26777794ade5
8212154: [TESTBUG] CheckArchivedModuleApp fails with NPE when JVMCI is absent
ccheung
parents:
51688
diff
changeset
|
55 |
Boolean enableJVMCI = wb.getBooleanVMFlag("EnableJVMCI"); |
26777794ade5
8212154: [TESTBUG] CheckArchivedModuleApp fails with NPE when JVMCI is absent
ccheung
parents:
51688
diff
changeset
|
56 |
if (enableJVMCI != null && enableJVMCI) { |
51688
fd3b632801aa
8210515: [TESTBUG]CheckArchivedModuleApp.java needs to check if EnableJVMCI is set.
jiangli
parents:
51371
diff
changeset
|
57 |
expectArchivedDescriptors = false; |
fd3b632801aa
8210515: [TESTBUG]CheckArchivedModuleApp.java needs to check if EnableJVMCI is set.
jiangli
parents:
51371
diff
changeset
|
58 |
expectArchivedConfiguration = false; |
fd3b632801aa
8210515: [TESTBUG]CheckArchivedModuleApp.java needs to check if EnableJVMCI is set.
jiangli
parents:
51371
diff
changeset
|
59 |
} |
fd3b632801aa
8210515: [TESTBUG]CheckArchivedModuleApp.java needs to check if EnableJVMCI is set.
jiangli
parents:
51371
diff
changeset
|
60 |
|
51371
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
61 |
checkModuleDescriptors(expectArchivedDescriptors); |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
62 |
checkConfiguration(expectArchivedConfiguration); |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
63 |
checkEmptyConfiguration(expectArchivedConfiguration); |
50951
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
64 |
} |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
65 |
|
51371
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
66 |
private static void checkModuleDescriptors(boolean expectArchivedDescriptors) { |
50951
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
67 |
Set<Module> modules = ModuleLayer.boot().modules(); |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
68 |
for (Module m : modules) { |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
69 |
ModuleDescriptor md = m.getDescriptor(); |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
70 |
String name = md.name(); |
51371
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
71 |
if (expectArchivedDescriptors) { |
50951
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
72 |
if (wb.isShared(md)) { |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
73 |
System.out.println(name + " is archived. Expected."); |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
74 |
} else { |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
75 |
throw new RuntimeException( |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
76 |
"FAILED. " + name + " is not archived. Expect archived."); |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
77 |
} |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
78 |
} else { |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
79 |
if (!wb.isShared(md)) { |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
80 |
System.out.println(name + " is not archived. Expected."); |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
81 |
} else { |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
82 |
throw new RuntimeException( |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
83 |
"FAILED. " + name + " is archived. Expect not archived."); |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
84 |
} |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
85 |
} |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
86 |
} |
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
87 |
} |
51371
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
88 |
|
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
89 |
private static void checkEmptyConfiguration(boolean expectArchivedConfiguration) { |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
90 |
// Configuration.EMPTY_CONFIGURATION uses the singletons, |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
91 |
// ListN.EMPTY_LIST, SetN.EMPTY_SET and MapN.EMPTY_MAP in |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
92 |
// ImmutableCollections for the 'parents', 'modules' and |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
93 |
// 'graph' fields. The ImmutableCollections singletons |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
94 |
// can be accessed via List.of(), Set.of() and Map.of() APIs. |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
95 |
// Configuration public APIs also allow access to the |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
96 |
// EMPTY_CONFIGURATION's 'parents' and 'modules'. When the |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
97 |
// archived java heap data is enabled at runtime, make sure |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
98 |
// the EMPTY_CONFIGURATION.parents and EMPTY_CONFIGURATION.modules |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
99 |
// are the archived ImmutableCollections singletons. |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
100 |
Configuration emptyCf = Configuration.empty(); |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
101 |
List emptyCfParents = emptyCf.parents(); |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
102 |
Set emptyCfModules = emptyCf.modules(); |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
103 |
if (expectArchivedConfiguration) { |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
104 |
if (emptyCfParents == List.of() && |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
105 |
wb.isShared(emptyCfParents)) { |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
106 |
System.out.println("Empty Configuration has expected parents."); |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
107 |
} else { |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
108 |
throw new RuntimeException( |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
109 |
"FAILED. Unexpected parents for empty Configuration."); |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
110 |
} |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
111 |
if (emptyCfModules == Set.of() && |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
112 |
wb.isShared(emptyCfModules)) { |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
113 |
System.out.println("Empty Configuration has expected module set."); |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
114 |
} else { |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
115 |
throw new RuntimeException( |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
116 |
"FAILED. Unexpected module set for empty Configuration."); |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
117 |
} |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
118 |
} |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
119 |
} |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
120 |
|
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
121 |
|
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
122 |
|
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
123 |
private static void checkConfiguration(boolean expectArchivedConfiguration) { |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
124 |
Configuration cf = ModuleLayer.boot().configuration(); |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
125 |
|
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
126 |
if (expectArchivedConfiguration) { |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
127 |
if (wb.isShared(cf)) { |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
128 |
System.out.println("Boot layer configuration is archived. Expected."); |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
129 |
} else { |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
130 |
throw new RuntimeException( |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
131 |
"FAILED. Boot layer configuration is not archived."); |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
132 |
} |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
133 |
} else { |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
134 |
if (!wb.isShared(cf)) { |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
135 |
System.out.println("Boot layer configuration is not archived. Expected."); |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
136 |
} else { |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
137 |
throw new RuntimeException( |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
138 |
"FAILED. Boot layer configuration is archived."); |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
139 |
} |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
140 |
} |
3ab8b84e93cd
8207263: Store the Configuration for system modules into CDS archive.
jiangli
parents:
50951
diff
changeset
|
141 |
} |
50951
b96466cdfc45
8202035: Archive the set of ModuleDescriptor and ModuleReference objects for observable system modules with unnamed initial module.
jiangli
parents:
diff
changeset
|
142 |
} |