--- old/test/jtreg-ext/requires/VMProps.java 2020-07-07 16:36:25.000000000 -0700 +++ new/test/jtreg-ext/requires/VMProps.java 2020-07-07 16:36:24.000000000 -0700 @@ -268,22 +268,41 @@ return CPUInfo.getFeatures().toString(); } + private boolean isGcSupportedByGraal(GC gc) { + switch (gc) { + case Serial: + case Parallel: + case G1: + return true; + case Epsilon: + case Z: + case Shenandoah: + return false; + default: + throw new IllegalStateException("Unknown GC " + gc.name()); + } + } + /** * For all existing GC sets vm.gc.X property. * Example vm.gc.G1=true means: * VM supports G1 * User either set G1 explicitely (-XX:+UseG1GC) or did not set any GC + * G1 can be selected, i.e. it doesn't conflict with other VM flags * * @param map - property-value pairs */ protected void vmGC(SafeMap map) { + var isGraalEnabled = Compiler.isGraalEnabled(); for (GC gc: GC.values()) { map.put("vm.gc." + gc.name(), () -> "" + (gc.isSupported() + && (!isGraalEnabled || isGcSupportedByGraal(gc)) && (gc.isSelected() || GC.isSelectedErgonomically()))); } } + /** * Selected final flag. *