105 map.put("vm.simpleArch", this::vmArch);
106 map.put("vm.debug", this::vmDebug);
107 map.put("vm.jvmci", this::vmJvmci);
108 map.put("vm.jvmci.enabled", this::vmJvmciEnabled);
109 map.put("vm.emulatedClient", this::vmEmulatedClient);
110 // vm.hasSA is "true" if the VM contains the serviceability agent
111 // and jhsdb.
112 map.put("vm.hasSA", this::vmHasSA);
113 // vm.hasJFR is "true" if JFR is included in the build of the VM and
114 // so tests can be executed.
115 map.put("vm.hasJFR", this::vmHasJFR);
116 map.put("vm.hasDTrace", this::vmHasDTrace);
117 map.put("vm.jvmti", this::vmHasJVMTI);
118 map.put("vm.cpu.features", this::cpuFeatures);
119 map.put("vm.pageSize", this::vmPageSize);
120 map.put("vm.rtm.cpu", this::vmRTMCPU);
121 map.put("vm.rtm.compiler", this::vmRTMCompiler);
122 // vm.cds is true if the VM is compiled with cds support.
123 map.put("vm.cds", this::vmCDS);
124 map.put("vm.cds.custom.loaders", this::vmCDSForCustomLoaders);
125 map.put("vm.cds.write.archived.java.heap", this::vmCDSCanWriteArchivedJavaHeap);
126 map.put("vm.continuations", this::vmContinuations);
127 // vm.graal.enabled is true if Graal is used as JIT
128 map.put("vm.graal.enabled", this::isGraalEnabled);
129 // jdk.hasLibgraal is true if the libgraal shared library file is present
130 map.put("jdk.hasLibgraal", this::hasLibgraal);
131 map.put("vm.libgraal.jit", this::isLibgraalJIT);
132 map.put("vm.compiler1.enabled", this::isCompiler1Enabled);
133 map.put("vm.compiler2.enabled", this::isCompiler2Enabled);
134 map.put("docker.support", this::dockerSupport);
135 map.put("systemd.support", this::systemdSupport);
136 map.put("vm.musl", this::isMusl);
137 map.put("release.implementor", this::implementor);
138 map.put("jdk.containerized", this::jdkContainerized);
139 map.put("vm.flagless", this::isFlagless);
140 map.put("jdk.foreign.linker", this::jdkForeignLinker);
141 vmGC(map); // vm.gc.X = true/false
142 vmGCforCDS(map); // may set vm.gc
143 vmOptFinalFlags(map);
144
451 return "" + WB.isCDSIncluded();
452 }
453
454 /**
455 * Check for CDS support for custom loaders.
456 *
457 * @return true if CDS provides support for customer loader in the VM to be tested.
458 */
459 protected String vmCDSForCustomLoaders() {
460 return "" + ("true".equals(vmCDS()) && Platform.areCustomLoadersSupportedForCDS());
461 }
462
463 /**
464 * @return true if this VM can write Java heap objects into the CDS archive
465 */
466 protected String vmCDSCanWriteArchivedJavaHeap() {
467 return "" + ("true".equals(vmCDS()) && WB.canWriteJavaHeapArchive()
468 && isCDSRuntimeOptionsCompatible());
469 }
470
471 /**
472 * @return true if the VM options specified via the "test.cds.runtime.options"
473 * property is compatible with writing Java heap objects into the CDS archive
474 */
475 protected boolean isCDSRuntimeOptionsCompatible() {
476 String jtropts = System.getProperty("test.cds.runtime.options");
477 if (jtropts == null) {
478 return true;
479 }
480 String CCP_DISABLED = "-XX:-UseCompressedClassPointers";
481 String G1GC_ENABLED = "-XX:+UseG1GC";
482 String PARALLELGC_ENABLED = "-XX:+UseParallelGC";
483 String SERIALGC_ENABLED = "-XX:+UseSerialGC";
484 for (String opt : jtropts.split(",")) {
485 if (opt.equals(CCP_DISABLED)) {
486 return false;
487 }
488 if (opt.startsWith(GC_PREFIX) && opt.endsWith(GC_SUFFIX) &&
489 !opt.equals(G1GC_ENABLED) && !opt.equals(PARALLELGC_ENABLED) && !opt.equals(SERIALGC_ENABLED)) {
490 return false;
|
105 map.put("vm.simpleArch", this::vmArch);
106 map.put("vm.debug", this::vmDebug);
107 map.put("vm.jvmci", this::vmJvmci);
108 map.put("vm.jvmci.enabled", this::vmJvmciEnabled);
109 map.put("vm.emulatedClient", this::vmEmulatedClient);
110 // vm.hasSA is "true" if the VM contains the serviceability agent
111 // and jhsdb.
112 map.put("vm.hasSA", this::vmHasSA);
113 // vm.hasJFR is "true" if JFR is included in the build of the VM and
114 // so tests can be executed.
115 map.put("vm.hasJFR", this::vmHasJFR);
116 map.put("vm.hasDTrace", this::vmHasDTrace);
117 map.put("vm.jvmti", this::vmHasJVMTI);
118 map.put("vm.cpu.features", this::cpuFeatures);
119 map.put("vm.pageSize", this::vmPageSize);
120 map.put("vm.rtm.cpu", this::vmRTMCPU);
121 map.put("vm.rtm.compiler", this::vmRTMCompiler);
122 // vm.cds is true if the VM is compiled with cds support.
123 map.put("vm.cds", this::vmCDS);
124 map.put("vm.cds.custom.loaders", this::vmCDSForCustomLoaders);
125 map.put("vm.cds.supports.aot.class.linking", this::vmCDSSupportsAOTClassLinking);
126 map.put("vm.cds.write.archived.java.heap", this::vmCDSCanWriteArchivedJavaHeap);
127 map.put("vm.continuations", this::vmContinuations);
128 // vm.graal.enabled is true if Graal is used as JIT
129 map.put("vm.graal.enabled", this::isGraalEnabled);
130 // jdk.hasLibgraal is true if the libgraal shared library file is present
131 map.put("jdk.hasLibgraal", this::hasLibgraal);
132 map.put("vm.libgraal.jit", this::isLibgraalJIT);
133 map.put("vm.compiler1.enabled", this::isCompiler1Enabled);
134 map.put("vm.compiler2.enabled", this::isCompiler2Enabled);
135 map.put("docker.support", this::dockerSupport);
136 map.put("systemd.support", this::systemdSupport);
137 map.put("vm.musl", this::isMusl);
138 map.put("release.implementor", this::implementor);
139 map.put("jdk.containerized", this::jdkContainerized);
140 map.put("vm.flagless", this::isFlagless);
141 map.put("jdk.foreign.linker", this::jdkForeignLinker);
142 vmGC(map); // vm.gc.X = true/false
143 vmGCforCDS(map); // may set vm.gc
144 vmOptFinalFlags(map);
145
452 return "" + WB.isCDSIncluded();
453 }
454
455 /**
456 * Check for CDS support for custom loaders.
457 *
458 * @return true if CDS provides support for customer loader in the VM to be tested.
459 */
460 protected String vmCDSForCustomLoaders() {
461 return "" + ("true".equals(vmCDS()) && Platform.areCustomLoadersSupportedForCDS());
462 }
463
464 /**
465 * @return true if this VM can write Java heap objects into the CDS archive
466 */
467 protected String vmCDSCanWriteArchivedJavaHeap() {
468 return "" + ("true".equals(vmCDS()) && WB.canWriteJavaHeapArchive()
469 && isCDSRuntimeOptionsCompatible());
470 }
471
472 /**
473 * @return true if this VM can support the -XX:AOTClassLinking option
474 */
475 protected String vmCDSSupportsAOTClassLinking() {
476 // Currently, the VM supports AOTClassLinking as long as it's able to write archived java heap.
477 return vmCDSCanWriteArchivedJavaHeap();
478 }
479
480 /**
481 * @return true if the VM options specified via the "test.cds.runtime.options"
482 * property is compatible with writing Java heap objects into the CDS archive
483 */
484 protected boolean isCDSRuntimeOptionsCompatible() {
485 String jtropts = System.getProperty("test.cds.runtime.options");
486 if (jtropts == null) {
487 return true;
488 }
489 String CCP_DISABLED = "-XX:-UseCompressedClassPointers";
490 String G1GC_ENABLED = "-XX:+UseG1GC";
491 String PARALLELGC_ENABLED = "-XX:+UseParallelGC";
492 String SERIALGC_ENABLED = "-XX:+UseSerialGC";
493 for (String opt : jtropts.split(",")) {
494 if (opt.equals(CCP_DISABLED)) {
495 return false;
496 }
497 if (opt.startsWith(GC_PREFIX) && opt.endsWith(GC_SUFFIX) &&
498 !opt.equals(G1GC_ENABLED) && !opt.equals(PARALLELGC_ENABLED) && !opt.equals(SERIALGC_ENABLED)) {
499 return false;
|