8202611: [GRAAL] Exclude CMS GC testing from runs with Graal
authorkvn
Thu, 07 Jun 2018 17:38:34 -0700
changeset 50455 2b73cce96dce
parent 50454 d134badc8a42
child 50456 cb75455ada5a
8202611: [GRAAL] Exclude CMS GC testing from runs with Graal Reviewed-by: iignatyev, kbarrett
test/hotspot/jtreg/gc/TestAgeOutput.java
test/hotspot/jtreg/gc/TestGenerationPerfCounter.java
test/hotspot/jtreg/gc/TestMemoryInitializationWithCMS.java
test/hotspot/jtreg/gc/TestMemoryMXBeansAndPoolsPresence.java
test/hotspot/jtreg/gc/TestNumWorkerOutput.java
test/hotspot/jtreg/gc/TestSystemGC.java
test/hotspot/jtreg/gc/arguments/TestAlignmentToUseLargePages.java
test/hotspot/jtreg/gc/arguments/TestCMSHeapSizeFlags.java
test/hotspot/jtreg/gc/arguments/TestMaxNewSize.java
test/hotspot/jtreg/gc/arguments/TestUseCompressedOopsErgo.java
test/hotspot/jtreg/gc/class_unloading/TestCMSClassUnloadingEnabledHWM.java
test/hotspot/jtreg/gc/class_unloading/TestClassUnloadingDisabled.java
test/hotspot/jtreg/gc/cms/DisableResizePLAB.java
test/hotspot/jtreg/gc/cms/GuardShrinkWarning.java
test/hotspot/jtreg/gc/cms/TestBubbleUpRef.java
test/hotspot/jtreg/gc/cms/TestCMSScavengeBeforeRemark.java
test/hotspot/jtreg/gc/cms/TestMBeanCMS.java
test/hotspot/jtreg/gc/concurrent_phase_control/TestConcurrentPhaseControlCMS.java
test/hotspot/jtreg/gc/metaspace/TestMetaspaceCMSCancel.java
test/hotspot/jtreg/gc/startup_warnings/TestCMS.java
test/hotspot/jtreg/gc/stress/TestReclaimStringsLeaksMemory.java
test/hotspot/jtreg/gc/stress/gcbasher/TestGCBasherWithCMS.java
test/hotspot/jtreg/gc/stress/gclocker/TestGCLockerWithCMS.java
test/hotspot/jtreg/gc/stress/gcold/TestGCOldWithCMS.java
test/hotspot/jtreg/gc/stress/systemgc/TestSystemGCWithCMS.java
test/hotspot/jtreg/runtime/CompressedOops/UseCompressedOops.java
test/hotspot/jtreg/runtime/MemberName/MemberNameLeak.java
test/hotspot/jtreg/runtime/appcds/CommandLineFlagCombo.java
test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions.java
test/hotspot/jtreg/serviceability/sa/TestUniverse.java
test/jdk/ProblemList-graal.txt
test/jdk/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java
test/jdk/java/lang/management/MemoryMXBean/CollectionUsageThreshold.java
test/jdk/java/lang/management/MemoryMXBean/LowMemoryTest.java
test/jdk/java/lang/management/MemoryMXBean/MemoryManagementConcMarkSweepGC.sh
test/jdk/java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java
test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithCMSConcurrent.java
test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithCMSMarkSweep.java
test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithCMSConcurrent.java
test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithCMSMarkSweep.java
test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithParNew.java
test/jdk/jdk/jfr/event/gc/collection/TestYoungGarbageCollectionEventWithParNew.java
test/jdk/jdk/jfr/event/gc/detailed/TestCMSConcurrentModeFailureEvent.java
test/jdk/jdk/jfr/event/gc/detailed/TestPromotionFailedEventWithParNew.java
test/jdk/jdk/jfr/event/gc/detailed/TestStressAllocationGCEventsWithCMS.java
test/jdk/jdk/jfr/event/gc/detailed/TestStressAllocationGCEventsWithParNew.java
test/jdk/jdk/jfr/event/gc/detailed/TestStressBigAllocationGCEventsWithCMS.java
test/jdk/jdk/jfr/event/gc/detailed/TestStressBigAllocationGCEventsWithParNew.java
test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryEventConcurrentCMS.java
test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryEventParNewCMS.java
test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithCMSConcurrent.java
test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithCMSMarkSweep.java
test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithCMSConcurrent.java
test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithCMSMarkSweep.java
test/jdk/jdk/jfr/event/gc/stacktrace/TestConcMarkSweepAllocationPendingStackTrace.java
test/jdk/jdk/jfr/event/gc/stacktrace/TestMetaspaceConcMarkSweepGCAllocationPendingStackTrace.java
test/jdk/jdk/jfr/event/gc/stacktrace/TestParNewAllocationPendingStackTrace.java
test/jdk/jdk/jfr/event/oldobject/TestCMS.java
test/jdk/jdk/jfr/event/runtime/TestModuleEvents.java
test/jtreg-ext/requires/VMProps.java
test/lib/sun/hotspot/code/Compiler.java
--- a/test/hotspot/jtreg/gc/TestAgeOutput.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/hotspot/jtreg/gc/TestAgeOutput.java	Thu Jun 07 17:38:34 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,8 +32,20 @@
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  * @run main/othervm -XX:+UseSerialGC TestAgeOutput UseSerialGC
+ * @run main/othervm -XX:+UseG1GC TestAgeOutput UseG1GC
+ */
+
+/*
+ * @test TestAgeOutputCMS
+ * @bug 8164936
+ * @key gc
+ * @comment Graal does not support CMS
+ * @requires vm.gc=="null" & !vm.graal.enabled
+ * @modules java.base/jdk.internal.misc
+ * @library /test/lib
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  * @run main/othervm -XX:+UseConcMarkSweepGC TestAgeOutput UseConcMarkSweepGC
- * @run main/othervm -XX:+UseG1GC TestAgeOutput UseG1GC
  */
 
 import sun.hotspot.WhiteBox;
--- a/test/hotspot/jtreg/gc/TestGenerationPerfCounter.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/hotspot/jtreg/gc/TestGenerationPerfCounter.java	Thu Jun 07 17:38:34 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,8 +38,21 @@
  * @run main/othervm -XX:+UsePerfData -XX:+UseSerialGC TestGenerationPerfCounter
  * @run main/othervm -XX:+UsePerfData -XX:+UseParallelGC TestGenerationPerfCounter
  * @run main/othervm -XX:+UsePerfData -XX:+UseG1GC TestGenerationPerfCounter
+ */
+
+/* @test TestGenerationPerfCounterCMS
+ * @bug 8080345
+ * @comment Graal does not support CMS
+ * @requires vm.gc=="null" & !vm.graal.enabled
+ * @library /test/lib /
+ * @summary Tests that the sun.gc.policy.generations returns 2 for all GCs.
+ * @modules java.base/jdk.internal.misc
+ *          java.compiler
+ *          java.management/sun.management
+ *          jdk.internal.jvmstat/sun.jvmstat.monitor
  * @run main/othervm -XX:+UsePerfData -XX:+UseConcMarkSweepGC TestGenerationPerfCounter
  */
+
 public class TestGenerationPerfCounter {
     public static void main(String[] args) throws Exception {
         long numGenerations =
--- a/test/hotspot/jtreg/gc/TestMemoryInitializationWithCMS.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/hotspot/jtreg/gc/TestMemoryInitializationWithCMS.java	Thu Jun 07 17:38:34 2018 -0700
@@ -1,6 +1,5 @@
-
 /*
- * Copyright (c) 2002, 2017 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2018 Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +25,7 @@
  * @test TestMemoryInitializationWithCMS
  * @key gc
  * @bug 4668531
- * @requires vm.debug & vm.gc.ConcMarkSweep
+ * @requires vm.debug & vm.gc.ConcMarkSweep & !vm.graal.enabled
  * @summary Simple test for -XX:+CheckMemoryInitialization doesn't crash VM
  * @run main/othervm -XX:+UseConcMarkSweepGC -XX:+CheckMemoryInitialization TestMemoryInitializationWithCMS
  */
--- a/test/hotspot/jtreg/gc/TestMemoryMXBeansAndPoolsPresence.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/hotspot/jtreg/gc/TestMemoryMXBeansAndPoolsPresence.java	Thu Jun 07 17:38:34 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -35,11 +35,20 @@
  *          java.management
  * @requires vm.gc == null
  * @run main/othervm -XX:+UseG1GC TestMemoryMXBeansAndPoolsPresence G1
- * @run main/othervm -XX:+UseConcMarkSweepGC TestMemoryMXBeansAndPoolsPresence CMS
  * @run main/othervm -XX:+UseParallelGC TestMemoryMXBeansAndPoolsPresence Parallel
  * @run main/othervm -XX:+UseSerialGC TestMemoryMXBeansAndPoolsPresence Serial
  */
 
+/* @test TestMemoryMXBeansAndPoolsPresenceCMS
+ * @bug 8191564
+ * @library /test/lib
+ * @modules java.base/jdk.internal.misc
+ *          java.management
+ * @comment Graal does not support CMS
+ * @requires vm.gc == null & !vm.graal.enabled
+ * @run main/othervm -XX:+UseConcMarkSweepGC TestMemoryMXBeansAndPoolsPresence CMS
+ */
+
 class GCBeanDescription {
     public String name;
     public String[] poolNames;
--- a/test/hotspot/jtreg/gc/TestNumWorkerOutput.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/hotspot/jtreg/gc/TestNumWorkerOutput.java	Thu Jun 07 17:38:34 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,8 +31,20 @@
  * @library /test/lib
  * @build sun.hotspot.WhiteBox
  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -XX:+UseG1GC TestNumWorkerOutput UseG1GC
+ */
+
+/*
+ * @test TestNumWorkerOutputCMS
+ * @bug 8165292
+ * @key gc
+ * @comment Graal does not support CMS
+ * @requires vm.gc=="null" & !vm.graal.enabled
+ * @modules java.base/jdk.internal.misc
+ * @library /test/lib
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  * @run main/othervm -XX:+UseConcMarkSweepGC TestNumWorkerOutput UseConcMarkSweepGC
- * @run main/othervm -XX:+UseG1GC TestNumWorkerOutput UseG1GC
  */
 
 import sun.hotspot.WhiteBox;
--- a/test/hotspot/jtreg/gc/TestSystemGC.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/hotspot/jtreg/gc/TestSystemGC.java	Thu Jun 07 17:38:34 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,14 +30,21 @@
  * @run main/othervm -XX:+UseSerialGC TestSystemGC
  * @run main/othervm -XX:+UseParallelGC TestSystemGC
  * @run main/othervm -XX:+UseParallelGC -XX:-UseParallelOldGC TestSystemGC
- * @run main/othervm -XX:+UseConcMarkSweepGC TestSystemGC
- * @run main/othervm -XX:+UseConcMarkSweepGC -XX:+ExplicitGCInvokesConcurrent TestSystemGC
  * @run main/othervm -XX:+UseG1GC TestSystemGC
  * @run main/othervm -XX:+UseG1GC -XX:+ExplicitGCInvokesConcurrent TestSystemGC
  * @run main/othervm -XX:+UseLargePages TestSystemGC
  * @run main/othervm -XX:+UseLargePages -XX:+UseLargePagesInMetaspace TestSystemGC
  */
 
+/*
+ * @test TestSystemGCCMS
+ * @key gc
+ * @comment Graal does not support CMS
+ * @requires vm.gc=="null" & !vm.graal.enabled
+ * @run main/othervm -XX:+UseConcMarkSweepGC TestSystemGC
+ * @run main/othervm -XX:+UseConcMarkSweepGC -XX:+ExplicitGCInvokesConcurrent TestSystemGC
+ */
+
 public class TestSystemGC {
   public static void main(String args[]) throws Exception {
     System.gc();
--- a/test/hotspot/jtreg/gc/arguments/TestAlignmentToUseLargePages.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/hotspot/jtreg/gc/arguments/TestAlignmentToUseLargePages.java	Thu Jun 07 17:38:34 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,10 +34,18 @@
  * @run main/othervm -Xms71M -Xmx91M -XX:+UseParallelGC -XX:+UseParallelOldGC -XX:-UseLargePages TestAlignmentToUseLargePages
  * @run main/othervm -Xms71M -Xmx91M -XX:+UseSerialGC -XX:+UseLargePages TestAlignmentToUseLargePages
  * @run main/othervm -Xms71M -Xmx91M -XX:+UseSerialGC -XX:-UseLargePages TestAlignmentToUseLargePages
+ * @run main/othervm -Xms71M -Xmx91M -XX:+UseG1GC -XX:+UseLargePages TestAlignmentToUseLargePages
+ * @run main/othervm -Xms71M -Xmx91M -XX:+UseG1GC -XX:-UseLargePages TestAlignmentToUseLargePages
+ */
+
+/**
+ * @test TestAlignmentToUseLargePagesCMS
+ * @key gc regression
+ * @bug 8024396
+ * @comment Graal does not support CMS
+ * @requires vm.gc=="null" & !vm.graal.enabled
  * @run main/othervm -Xms71M -Xmx91M -XX:+UseConcMarkSweepGC -XX:+UseLargePages TestAlignmentToUseLargePages
  * @run main/othervm -Xms71M -Xmx91M -XX:+UseConcMarkSweepGC -XX:-UseLargePages TestAlignmentToUseLargePages
- * @run main/othervm -Xms71M -Xmx91M -XX:+UseG1GC -XX:+UseLargePages TestAlignmentToUseLargePages
- * @run main/othervm -Xms71M -Xmx91M -XX:+UseG1GC -XX:-UseLargePages TestAlignmentToUseLargePages
  */
 
 public class TestAlignmentToUseLargePages {
--- a/test/hotspot/jtreg/gc/arguments/TestCMSHeapSizeFlags.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/hotspot/jtreg/gc/arguments/TestCMSHeapSizeFlags.java	Thu Jun 07 17:38:34 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
  * @test TestCMSHeapSizeFlags
  * @key gc
  * @bug 8006088
- * @requires vm.gc.ConcMarkSweep
+ * @requires vm.gc.ConcMarkSweep & !vm.graal.enabled
  * @summary Tests argument processing for initial and maximum heap size for the CMS collector
  * @library /test/lib
  * @modules java.base/jdk.internal.misc
--- a/test/hotspot/jtreg/gc/arguments/TestMaxNewSize.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/hotspot/jtreg/gc/arguments/TestMaxNewSize.java	Thu Jun 07 17:38:34 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,16 +27,28 @@
  * @bug 7057939
  * @summary Make sure that MaxNewSize always has a useful value after argument
  * processing.
+ * @requires vm.gc=="null"
  * @library /test/lib
  * @modules java.base/jdk.internal.misc
  *          java.management
  * @run main TestMaxNewSize -XX:+UseSerialGC
  * @run main TestMaxNewSize -XX:+UseParallelGC
- * @run main TestMaxNewSize -XX:+UseConcMarkSweepGC
  * @run main TestMaxNewSize -XX:+UseG1GC
  * @author thomas.schatzl@oracle.com, jesper.wilhelmsson@oracle.com
  */
 
+/*
+ * @test TestMaxNewSizeCMS
+ * @key gc
+ * @bug 7057939
+ * @comment Graal does not support CMS
+ * @requires vm.gc=="null" & !vm.graal.enabled
+ * @library /test/lib
+ * @modules java.base/jdk.internal.misc
+ *          java.management
+ * @run main TestMaxNewSize -XX:+UseConcMarkSweepGC
+ */
+
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
--- a/test/hotspot/jtreg/gc/arguments/TestUseCompressedOopsErgo.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/hotspot/jtreg/gc/arguments/TestUseCompressedOopsErgo.java	Thu Jun 07 17:38:34 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
  * @key gc
  * @bug 8010722
  * @summary Tests ergonomics for UseCompressedOops.
+ * @requires vm.gc=="null"
  * @library /test/lib
  * @modules java.base/jdk.internal.misc
  *          java.management/sun.management
@@ -35,8 +36,22 @@
  * @run main/othervm TestUseCompressedOopsErgo -XX:+UseG1GC
  * @run main/othervm TestUseCompressedOopsErgo -XX:+UseParallelGC
  * @run main/othervm TestUseCompressedOopsErgo -XX:+UseParallelGC -XX:-UseParallelOldGC
+ * @run main/othervm TestUseCompressedOopsErgo -XX:+UseSerialGC
+ */
+
+/*
+ * @test TestUseCompressedOopsErgoCMS
+ * @key gc
+ * @bug 8010722
+ * @comment Graal does not support CMS
+ * @requires vm.gc=="null" & !vm.graal.enabled
+ * @library /test/lib
+ * @modules java.base/jdk.internal.misc
+ *          java.management/sun.management
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm TestUseCompressedOopsErgo -XX:+UseConcMarkSweepGC
- * @run main/othervm TestUseCompressedOopsErgo -XX:+UseSerialGC
  */
 
 public class TestUseCompressedOopsErgo {
--- a/test/hotspot/jtreg/gc/class_unloading/TestCMSClassUnloadingEnabledHWM.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/hotspot/jtreg/gc/class_unloading/TestCMSClassUnloadingEnabledHWM.java	Thu Jun 07 17:38:34 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
  * @test
  * @key gc
  * @bug 8049831
+ * @requires !vm.graal.enabled
  * @library /test/lib
  * @modules java.base/jdk.internal.misc
  *          java.management
--- a/test/hotspot/jtreg/gc/class_unloading/TestClassUnloadingDisabled.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/hotspot/jtreg/gc/class_unloading/TestClassUnloadingDisabled.java	Thu Jun 07 17:38:34 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -44,6 +44,22 @@
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:-ClassUnloading -XX:+UseParallelGC TestClassUnloadingDisabled
  *
+ */
+
+/*
+ * @test
+ * @key gc
+ * @bug 8114823
+ * @comment Graal does not support CMS
+ * @requires vm.gc=="null" & !vm.graal.enabled
+ * @requires vm.opt.ExplicitGCInvokesConcurrent != true
+ * @requires vm.opt.ClassUnloading != true
+ * @library /test/lib
+ * @modules java.base/jdk.internal.misc
+ *          java.management
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  *                   -XX:-ClassUnloading -XX:+UseConcMarkSweepGC TestClassUnloadingDisabled
  */
--- a/test/hotspot/jtreg/gc/cms/DisableResizePLAB.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/hotspot/jtreg/gc/cms/DisableResizePLAB.java	Thu Jun 07 17:38:34 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
  * @key gc
  * @bug 8060467
  * @author filipp.zhinkin@oracle.com, john.coomes@oracle.com
- * @requires vm.gc.ConcMarkSweep
+ * @requires vm.gc.ConcMarkSweep & !vm.graal.enabled
  * @summary Run CMS with PLAB resizing disabled and a small OldPLABSize
  * @run main/othervm -XX:+UseConcMarkSweepGC -XX:-ResizePLAB -XX:OldPLABSize=1k -Xmx256m -Xlog:gc=debug DisableResizePLAB
  */
--- a/test/hotspot/jtreg/gc/cms/GuardShrinkWarning.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/hotspot/jtreg/gc/cms/GuardShrinkWarning.java	Thu Jun 07 17:38:34 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
  * @key gc regression
  * @summary Remove warning about CMS generation shrinking.
  * @bug 8012111
+ * @requires !vm.graal.enabled
  * @library /test/lib
  * @modules java.base/jdk.internal.misc
  *          java.management
--- a/test/hotspot/jtreg/gc/cms/TestBubbleUpRef.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/hotspot/jtreg/gc/cms/TestBubbleUpRef.java	Thu Jun 07 17:38:34 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,7 @@
 
 /*
  * @test
- * @requires vm.gc.ConcMarkSweep
+ * @requires vm.gc.ConcMarkSweep & !vm.graal.enabled
  * @key cte_test
  * @bug 4950157
  * @summary Stress the behavior of ergonomics when the heap is nearly full and
--- a/test/hotspot/jtreg/gc/cms/TestCMSScavengeBeforeRemark.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/hotspot/jtreg/gc/cms/TestCMSScavengeBeforeRemark.java	Thu Jun 07 17:38:34 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
  * @test TestCMSScavengeBeforeRemark
  * @key gc
  * @bug 8139868
- * @requires vm.gc.ConcMarkSweep
+ * @requires vm.gc.ConcMarkSweep & !vm.graal.enabled
  * @summary Run CMS with CMSScavengeBeforeRemark
  * @run main/othervm -XX:+UseConcMarkSweepGC -XX:+CMSScavengeBeforeRemark -XX:+ExplicitGCInvokesConcurrent -Xmx256m -Xlog:gc=debug TestCMSScavengeBeforeRemark
  */
--- a/test/hotspot/jtreg/gc/cms/TestMBeanCMS.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/hotspot/jtreg/gc/cms/TestMBeanCMS.java	Thu Jun 07 17:38:34 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
 /*
  * @test TestMBeanCMS.java
  * @bug 6581734
- * @requires vm.gc.ConcMarkSweep
+ * @requires vm.gc.ConcMarkSweep & !vm.graal.enabled
  * @summary CMS Old Gen's collection usage is zero after GC which is incorrect
  * @modules java.management
  * @run main/othervm -Xmx512m -verbose:gc -XX:+UseConcMarkSweepGC TestMBeanCMS
--- a/test/hotspot/jtreg/gc/concurrent_phase_control/TestConcurrentPhaseControlCMS.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/hotspot/jtreg/gc/concurrent_phase_control/TestConcurrentPhaseControlCMS.java	Thu Jun 07 17:38:34 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
 /*
  * @test TestConcurrentPhaseControlCMS
  * @bug 8169517
- * @requires vm.gc.ConcMarkSweep
+ * @requires vm.gc.ConcMarkSweep & !vm.graal.enabled
  * @summary Verify CMS GC doesn't support WhiteBox concurrent phase control.
  * @key gc
  * @modules java.base
--- a/test/hotspot/jtreg/gc/metaspace/TestMetaspaceCMSCancel.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/hotspot/jtreg/gc/metaspace/TestMetaspaceCMSCancel.java	Thu Jun 07 17:38:34 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,7 @@
 /* @test TestMetaspaceCMSCancel
  * @bug 8026752
  * @summary Tests cancel of CMS concurrent cycle for Metaspace after a full GC
+ * @requires !vm.graal.enabled
  * @library /test/lib
  * @modules java.base/jdk.internal.misc
  * @build sun.hotspot.WhiteBox
--- a/test/hotspot/jtreg/gc/startup_warnings/TestCMS.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/hotspot/jtreg/gc/startup_warnings/TestCMS.java	Thu Jun 07 17:38:34 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,14 +22,15 @@
  */
 
 /*
-* @test TestCMS
-* @key gc
-* @bug 8006398 8155948 8179013
-* @summary Test that CMS prints a warning message
-* @library /test/lib
-* @modules java.base/jdk.internal.misc
-*          java.management
-*/
+ * @test TestCMS
+ * @key gc
+ * @bug 8006398 8155948 8179013
+ * @summary Test that CMS prints a warning message
+ * @requires !vm.graal.enabled
+ * @library /test/lib
+ * @modules java.base/jdk.internal.misc
+ *          java.management
+ */
 
 import jdk.test.lib.process.ProcessTools;
 import jdk.test.lib.process.OutputAnalyzer;
--- a/test/hotspot/jtreg/gc/stress/TestReclaimStringsLeaksMemory.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/hotspot/jtreg/gc/stress/TestReclaimStringsLeaksMemory.java	Thu Jun 07 17:38:34 2018 -0700
@@ -25,8 +25,7 @@
  * @test TestReclaimStringsLeaksMemory
  * @bug 8180048
  * @summary Ensure that during a Full GC interned string memory is reclaimed completely.
- * @requires vm.gc=="null"
- * @requires !vm.debug
+ * @requires vm.gc=="null" & !vm.graal.enabled & !vm.debug
  * @key gc
  * @library /test/lib
  * @modules java.base/jdk.internal.misc
--- a/test/hotspot/jtreg/gc/stress/gcbasher/TestGCBasherWithCMS.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/hotspot/jtreg/gc/stress/gcbasher/TestGCBasherWithCMS.java	Thu Jun 07 17:38:34 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,7 @@
  * @test TestGCBasherWithCMS
  * @key gc stress
  * @requires vm.gc.ConcMarkSweep
- * @requires vm.flavor == "server" & !vm.emulatedClient
+ * @requires vm.flavor == "server" & !vm.emulatedClient & !vm.graal.enabled
  * @summary Stress the CMS GC by trying to make old objects more likely to be garbage than young objects.
  * @run main/othervm/timeout=200 -Xlog:gc*=info -Xmx256m -server -XX:+UseConcMarkSweepGC TestGCBasherWithCMS 120000
  */
--- a/test/hotspot/jtreg/gc/stress/gclocker/TestGCLockerWithCMS.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/hotspot/jtreg/gc/stress/gclocker/TestGCLockerWithCMS.java	Thu Jun 07 17:38:34 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
 /*
  * @test TestGCLockerWithCMS
  * @key gc
- * @requires vm.gc.ConcMarkSweep
+ * @requires vm.gc.ConcMarkSweep & !vm.graal.enabled
  * @summary Stress CMS' GC locker by calling GetPrimitiveArrayCritical while concurrently filling up old gen.
  * @run main/native/othervm/timeout=200 -Xlog:gc*=info -Xms1500m -Xmx1500m -XX:+UseConcMarkSweepGC TestGCLockerWithCMS
  */
--- a/test/hotspot/jtreg/gc/stress/gcold/TestGCOldWithCMS.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/hotspot/jtreg/gc/stress/gcold/TestGCOldWithCMS.java	Thu Jun 07 17:38:34 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
 /*
  * @test TestGCOldWithCMS
  * @key gc
- * @requires vm.gc.ConcMarkSweep
+ * @requires vm.gc.ConcMarkSweep & !vm.graal.enabled
  * @summary Stress the CMS GC by trying to make old objects more likely to be garbage than young objects.
  * @run main/othervm -Xmx384M -XX:+UseConcMarkSweepGC TestGCOldWithCMS 50 1 20 10 10000
  */
--- a/test/hotspot/jtreg/gc/stress/systemgc/TestSystemGCWithCMS.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/hotspot/jtreg/gc/stress/systemgc/TestSystemGCWithCMS.java	Thu Jun 07 17:38:34 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
  * @test TestSystemGCWithCMS
  * @key gc stress
  * @bug 8190703
- * @requires vm.gc.ConcMarkSweep
+ * @requires vm.gc.ConcMarkSweep & !vm.graal.enabled
  * @summary Stress the CMS GC full GC by allocating objects of different lifetimes concurrently with System.gc().
  * @run main/othervm/timeout=300 -Xlog:gc*=info -Xmx512m -XX:+UseConcMarkSweepGC TestSystemGCWithCMS 270
  */
--- a/test/hotspot/jtreg/runtime/CompressedOops/UseCompressedOops.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/hotspot/jtreg/runtime/CompressedOops/UseCompressedOops.java	Thu Jun 07 17:38:34 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,9 @@
  * @library /test/lib
  * @modules java.base/jdk.internal.misc
  *          java.management
- * @run main UseCompressedOops
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. UseCompressedOops
  */
 import java.util.ArrayList;
 import java.util.Collections;
@@ -36,6 +38,8 @@
 import jdk.test.lib.process.ProcessTools;
 import jdk.test.lib.process.OutputAnalyzer;
 
+import sun.hotspot.code.Compiler;
+
 public class UseCompressedOops {
 
     public static void main(String[] args) throws Exception {
@@ -51,7 +55,9 @@
         testCompressedOopsModes(args);
         // Test GCs.
         testCompressedOopsModes(args, "-XX:+UseG1GC");
-        testCompressedOopsModes(args, "-XX:+UseConcMarkSweepGC");
+        if (!Compiler.isGraalEnabled()) { // Graal does not support CMS
+            testCompressedOopsModes(args, "-XX:+UseConcMarkSweepGC");
+        }
         testCompressedOopsModes(args, "-XX:+UseSerialGC");
         testCompressedOopsModes(args, "-XX:+UseParallelGC");
         testCompressedOopsModes(args, "-XX:+UseParallelOldGC");
--- a/test/hotspot/jtreg/runtime/MemberName/MemberNameLeak.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/hotspot/jtreg/runtime/MemberName/MemberNameLeak.java	Thu Jun 07 17:38:34 2018 -0700
@@ -26,13 +26,17 @@
  * @bug 8174749
  * @summary MemberNameTable should reuse entries
  * @library /test/lib
- * @run main MemberNameLeak
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. MemberNameLeak
  */
 
 import java.lang.invoke.*;
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.process.ProcessTools;
 
+import sun.hotspot.code.Compiler;
+
 public class MemberNameLeak {
     static class Leak {
       public void callMe() {
@@ -69,6 +73,8 @@
         test("-XX:+UseG1GC");
         test("-XX:+UseParallelGC");
         test("-XX:+UseSerialGC");
-        test("-XX:+UseConcMarkSweepGC");
+        if (!Compiler.isGraalEnabled()) { // Graal does not support CMS
+            test("-XX:+UseConcMarkSweepGC");
+        }
     }
 }
--- a/test/hotspot/jtreg/runtime/appcds/CommandLineFlagCombo.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/hotspot/jtreg/runtime/appcds/CommandLineFlagCombo.java	Thu Jun 07 17:38:34 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,14 +32,18 @@
  * @modules java.base/jdk.internal.misc
  *          java.management
  *          jdk.jartool/sun.tools.jar
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
  * @compile test-classes/Hello.java
- * @run main/timeout=240 CommandLineFlagCombo
+ * @run main/othervm/timeout=240 -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. CommandLineFlagCombo
  */
 
 import jdk.test.lib.BuildHelper;
 import jdk.test.lib.Platform;
 import jdk.test.lib.process.OutputAnalyzer;
 
+import sun.hotspot.code.Compiler;
+
 public class CommandLineFlagCombo {
 
     // shared base address test table
@@ -122,6 +126,11 @@
             System.out.println("Test case not applicable on non-commercial builds");
             return true;
         }
+        if (Compiler.isGraalEnabled() && testEntry.equals("-XX:+UseConcMarkSweepGC"))
+        {
+            System.out.println("Graal does not support CMS");
+            return true;
+        }
 
         return false;
     }
--- a/test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions.java	Thu Jun 07 17:38:34 2018 -0700
@@ -32,13 +32,17 @@
  * @modules java.base/jdk.internal.misc
  * @modules java.management
  *          jdk.jartool/sun.tools.jar
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
  * @build HelloString
- * @run main IncompatibleOptions
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. IncompatibleOptions
  */
 
 import jdk.test.lib.Asserts;
 import jdk.test.lib.process.OutputAnalyzer;
 
+import sun.hotspot.code.Compiler;
+
 public class IncompatibleOptions {
     static final String COOPS_DUMP_WARNING =
         "Cannot dump shared archive when UseCompressedOops or UseCompressedClassPointers is off";
@@ -62,7 +66,9 @@
         // incompatible GCs
         testDump(2, "-XX:+UseParallelGC", "", GC_WARNING, false);
         testDump(3, "-XX:+UseSerialGC", "", GC_WARNING, false);
-        testDump(4, "-XX:+UseConcMarkSweepGC", "", GC_WARNING, false);
+        if (!Compiler.isGraalEnabled()) { // Graal does not support CMS
+            testDump(4, "-XX:+UseConcMarkSweepGC", "", GC_WARNING, false);
+        }
 
         // ======= archive with compressed oops, run w/o
         testDump(5, "-XX:+UseG1GC", "-XX:+UseCompressedOops", null, false);
@@ -73,7 +79,9 @@
         // Still run, to ensure no crash or exception
         testExec(6, "-XX:+UseParallelGC", "", "", false);
         testExec(7, "-XX:+UseSerialGC", "", "", false);
-        testExec(8, "-XX:+UseConcMarkSweepGC", "", "", false);
+        if (!Compiler.isGraalEnabled()) { // Graal does not support CMS
+            testExec(8, "-XX:+UseConcMarkSweepGC", "", "", false);
+        }
 
         // Test various oops encodings, by varying ObjectAlignmentInBytes and heap sizes
         testDump(9, "-XX:+UseG1GC", "-XX:ObjectAlignmentInBytes=8", null, false);
--- a/test/hotspot/jtreg/serviceability/sa/TestUniverse.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/hotspot/jtreg/serviceability/sa/TestUniverse.java	Thu Jun 07 17:38:34 2018 -0700
@@ -21,6 +21,8 @@
  * questions.
  */
 
+import sun.hotspot.code.Compiler;
+
 import java.util.ArrayList;
 import java.util.List;
 import java.io.IOException;
@@ -37,7 +39,9 @@
  * @bug 8190307
  * @library /test/lib
  * @build jdk.test.lib.apps.*
- * @run main/othervm TestUniverse
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. TestUniverse
  */
 
 public class TestUniverse {
@@ -132,7 +136,9 @@
             test("-XX:+UseG1GC");
             test("-XX:+UseParallelGC");
             test("-XX:+UseSerialGC");
-            test("-XX:+UseConcMarkSweepGC");
+            if (!Compiler.isGraalEnabled()) { // Graal does not support CMS
+              test("-XX:+UseConcMarkSweepGC");
+            }
         } catch (Exception e) {
             throw new Error("Test failed with " + e);
         }
--- a/test/jdk/ProblemList-graal.txt	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/jdk/ProblemList-graal.txt	Thu Jun 07 17:38:34 2018 -0700
@@ -68,3 +68,9 @@
 java/lang/ref/OOMEInReferenceHandler.java                               8196611   generic-all
 java/lang/Runtime/exec/LotsOfOutput.java                                8196611   generic-all
 java/util/concurrent/ScheduledThreadPoolExecutor/BasicCancelTest.java   8196611   generic-all
+
+# Next JFR tests fail with Graal. Assuming 8193210.
+jdk/jfr/event/compiler/TestCodeSweeper.java              8193210   generic-all
+jdk/jfr/event/compiler/TestCompilerInlining.java         8193210   generic-all
+jdk/jfr/event/compiler/TestCompilerPhase.java            8193210   generic-all
+
--- a/test/jdk/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/jdk/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java	Thu Jun 07 17:38:34 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,8 @@
  * @test
  * @bug 8028994
  * @author Staffan Larsen
+ * @comment Graal does not support CMS
+ * @requires !vm.graal.enabled
  * @library /lib/testlibrary
  * @modules jdk.attach/sun.tools.attach
  *          jdk.management
--- a/test/jdk/java/lang/management/MemoryMXBean/CollectionUsageThreshold.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/jdk/java/lang/management/MemoryMXBean/CollectionUsageThreshold.java	Thu Jun 07 17:38:34 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,11 +30,13 @@
  *
  * @author  Mandy Chung
  *
- * @library /lib/testlibrary/
+ * @library /lib/testlibrary/ /test/lib
  * @modules jdk.management
  * @build jdk.testlibrary.* CollectionUsageThreshold MemoryUtil RunUtil
  * @requires vm.opt.ExplicitGCInvokesConcurrent == "false" | vm.opt.ExplicitGCInvokesConcurrent == "null"
- * @run main/timeout=300 CollectionUsageThreshold
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm/timeout=300 -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. CollectionUsageThreshold
  */
 
 import java.util.*;
@@ -46,6 +48,8 @@
 import static java.lang.management.MemoryNotificationInfo.*;;
 import static java.lang.management.ManagementFactory.*;
 
+import sun.hotspot.code.Compiler;
+
 public class CollectionUsageThreshold {
     private static final MemoryMXBean mm = getMemoryMXBean();
     private static final Map<String, PoolRecord> result = new HashMap<>();
@@ -72,7 +76,9 @@
         RunUtil.runTestClearGcOpts(main, "-XX:+UseSerialGC");
         RunUtil.runTestClearGcOpts(main, "-XX:+UseParallelGC");
         RunUtil.runTestClearGcOpts(main, "-XX:+UseG1GC");
-        RunUtil.runTestClearGcOpts(main, "-XX:+UseConcMarkSweepGC");
+        if (!Compiler.isGraalEnabled()) { // Graal does not support CMS
+            RunUtil.runTestClearGcOpts(main, "-XX:+UseConcMarkSweepGC");
+        }
     }
 
     static class PoolRecord {
--- a/test/jdk/java/lang/management/MemoryMXBean/LowMemoryTest.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/jdk/java/lang/management/MemoryMXBean/LowMemoryTest.java	Thu Jun 07 17:38:34 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,10 +32,12 @@
  * @requires vm.gc == "null"
  * @requires vm.opt.ExplicitGCInvokesConcurrent != "true"
  * @requires vm.opt.DisableExplicitGC != "true"
- * @library /lib/testlibrary/
+ * @library /lib/testlibrary/ /test/lib
  *
  * @build jdk.testlibrary.* LowMemoryTest MemoryUtil RunUtil
- * @run main/timeout=600 LowMemoryTest
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm/timeout=600 -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. LowMemoryTest
  */
 
 import java.lang.management.*;
@@ -47,6 +49,8 @@
 import jdk.testlibrary.JDKToolFinder;
 import jdk.testlibrary.Utils;
 
+import sun.hotspot.code.Compiler;
+
 public class LowMemoryTest {
     private static final MemoryMXBean mm = ManagementFactory.getMemoryMXBean();
     private static final List<MemoryPoolMXBean> pools = ManagementFactory.getMemoryPoolMXBeans();
@@ -80,7 +84,9 @@
         traceTest(classMain + ", -XX:+UseSerialGC", nmFlag, lpFlag, "-XX:+UseSerialGC");
         traceTest(classMain + ", -XX:+UseParallelGC", nmFlag, lpFlag, "-XX:+UseParallelGC");
         traceTest(classMain + ", -XX:+UseG1GC", nmFlag, lpFlag, "-XX:+UseG1GC", g1Flag);
-        traceTest(classMain + ", -XX:+UseConcMarkSweepGC", nmFlag, lpFlag, "-XX:+UseConcMarkSweepGC");
+        if (!Compiler.isGraalEnabled()) { // Graal does not support CMS
+            traceTest(classMain + ", -XX:+UseConcMarkSweepGC", nmFlag, lpFlag, "-XX:+UseConcMarkSweepGC");
+        }
     }
 
     /*
--- a/test/jdk/java/lang/management/MemoryMXBean/MemoryManagementConcMarkSweepGC.sh	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/jdk/java/lang/management/MemoryMXBean/MemoryManagementConcMarkSweepGC.sh	Thu Jun 07 17:38:34 2018 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,7 @@
 # @summary Run MemoryManagement test with concurrent mark sweep GC
 # @author  Mandy Chung
 #
-# @requires vm.gc=="ConcMarkSweep" | vm.gc=="null"
+# @requires (vm.gc=="ConcMarkSweep" | vm.gc=="null") & !vm.graal.enabled
 #
 # @run build MemoryManagement
 # @run shell/timeout=600 MemoryManagementConcMarkSweepGC.sh
--- a/test/jdk/java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/jdk/java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java	Thu Jun 07 17:38:34 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -34,17 +34,21 @@
  *
  * @requires vm.opt.ExplicitGCInvokesConcurrent != "true"
  * @requires vm.opt.DisableExplicitGC != "true"
- * @library /lib/testlibrary/
+ * @library /lib/testlibrary/ /test/lib
  * @modules jdk.management
  *
  * @build jdk.testlibrary.* ResetPeakMemoryUsage MemoryUtil RunUtil
- * @run main ResetPeakMemoryUsage
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. ResetPeakMemoryUsage
  */
 
 import java.lang.management.*;
 import java.lang.ref.WeakReference;
 import java.util.*;
 
+import sun.hotspot.code.Compiler;
+
 public class ResetPeakMemoryUsage {
     private static MemoryMXBean mbean = ManagementFactory.getMemoryMXBean();
     // make public so that it can't be optimized away easily
@@ -59,7 +63,9 @@
         final String main = "ResetPeakMemoryUsage$TestMain";
         final String ms = "-Xms256m";
         final String mn = "-Xmn8m";
-        RunUtil.runTestClearGcOpts(main, ms, mn, "-XX:+UseConcMarkSweepGC");
+        if (!Compiler.isGraalEnabled()) { // Graal does not support CMS
+            RunUtil.runTestClearGcOpts(main, ms, mn, "-XX:+UseConcMarkSweepGC");
+        }
         RunUtil.runTestClearGcOpts(main, ms, mn, "-XX:+UseParallelGC");
         RunUtil.runTestClearGcOpts(main, ms, mn, "-XX:+UseG1GC", "-XX:G1HeapRegionSize=1m");
         RunUtil.runTestClearGcOpts(main, ms, mn, "-XX:+UseSerialGC",
--- a/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithCMSConcurrent.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithCMSConcurrent.java	Thu Jun 07 17:38:34 2018 -0700
@@ -29,7 +29,7 @@
 /*
  * @test
  * @key jfr
- * @requires vm.gc == "ConcMarkSweep" | vm.gc == null
+ * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null) & !vm.graal.enabled
  * @requires vm.opt.ExplicitGCInvokesConcurrent != false
  * @library /test/lib /test/jdk
  * @run driver jdk.jfr.event.gc.collection.TestGCCauseWithCMSConcurrent
--- a/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithCMSMarkSweep.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithCMSMarkSweep.java	Thu Jun 07 17:38:34 2018 -0700
@@ -30,7 +30,7 @@
  * @test
  * @key jfr
  *
- * @requires vm.gc == "ConcMarkSweep" | vm.gc == null
+ * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null) & !vm.graal.enabled
  * @requires vm.opt.ExplicitGCInvokesConcurrent != true
  * @library /test/lib /test/jdk
  * @run driver jdk.jfr.event.gc.collection.TestGCCauseWithCMSMarkSweep
--- a/test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithCMSConcurrent.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithCMSConcurrent.java	Thu Jun 07 17:38:34 2018 -0700
@@ -29,7 +29,7 @@
  * @test
  * @key jfr
  *
- * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null)
+ * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null) & !vm.graal.enabled
  *           & vm.opt.ExplicitGCInvokesConcurrent != false
  * @library /test/lib /test/jdk
  *
--- a/test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithCMSMarkSweep.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithCMSMarkSweep.java	Thu Jun 07 17:38:34 2018 -0700
@@ -29,7 +29,7 @@
  * @test
  * @key jfr
  *
- * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null)
+ * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null) & !vm.graal.enabled
  *           & vm.opt.ExplicitGCInvokesConcurrent != true
  * @library /test/lib /test/jdk
  *
--- a/test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithParNew.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithParNew.java	Thu Jun 07 17:38:34 2018 -0700
@@ -29,7 +29,7 @@
  * @test
  * @key jfr
  *
- * @requires vm.gc == "ConcMarkSweep" | vm.gc == null
+ * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null) & !vm.graal.enabled
  * @library /test/lib /test/jdk
  * @run main/othervm -Xmx32m -Xmn8m -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps -XX:+UseConcMarkSweepGC jdk.jfr.event.gc.collection.TestGCEventMixedWithParNew
  * good debug flags: -Xlog:gc*=debug
--- a/test/jdk/jdk/jfr/event/gc/collection/TestYoungGarbageCollectionEventWithParNew.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/jdk/jdk/jfr/event/gc/collection/TestYoungGarbageCollectionEventWithParNew.java	Thu Jun 07 17:38:34 2018 -0700
@@ -28,7 +28,7 @@
 /*
  * @test
  * @key jfr
- * @requires vm.gc == "ConcMarkSweep" | vm.gc == null
+ * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null) & !vm.graal.enabled
  * @library /test/lib /test/jdk
  * @run main/othervm -Xmx50m -Xmn2m -XX:+UseConcMarkSweepGC -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps -Xlog:gc+heap=trace,gc*=debug jdk.jfr.event.gc.collection.TestYoungGarbageCollectionEventWithParNew
  */
--- a/test/jdk/jdk/jfr/event/gc/detailed/TestCMSConcurrentModeFailureEvent.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/jdk/jdk/jfr/event/gc/detailed/TestCMSConcurrentModeFailureEvent.java	Thu Jun 07 17:38:34 2018 -0700
@@ -42,7 +42,7 @@
  * @test
  * @key jfr
  *
- * @requires vm.gc == "ConcMarkSweep" | vm.gc == null
+ * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null) & !vm.graal.enabled
  * @library /test/lib /test/jdk
  *
  * @run main jdk.jfr.event.gc.detailed.TestCMSConcurrentModeFailureEvent
--- a/test/jdk/jdk/jfr/event/gc/detailed/TestPromotionFailedEventWithParNew.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/jdk/jdk/jfr/event/gc/detailed/TestPromotionFailedEventWithParNew.java	Thu Jun 07 17:38:34 2018 -0700
@@ -27,7 +27,7 @@
 /*
  * @test
  * @key jfr
- * @requires vm.gc == "ConcMarkSweep" | vm.gc == null
+ * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null) & !vm.graal.enabled
  * @library /test/lib /test/jdk
  * @run main/othervm  jdk.jfr.event.gc.detailed.TestPromotionFailedEventWithParNew
  */
--- a/test/jdk/jdk/jfr/event/gc/detailed/TestStressAllocationGCEventsWithCMS.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/jdk/jdk/jfr/event/gc/detailed/TestStressAllocationGCEventsWithCMS.java	Thu Jun 07 17:38:34 2018 -0700
@@ -26,7 +26,7 @@
 
 /*
  * @test
- * @requires vm.gc == "null" | vm.gc == "ConcMarkSweep"
+ * @requires (vm.gc == "null" | vm.gc == "ConcMarkSweep") & !vm.graal.enabled
  * @library /test/lib /test/jdk
  * @run main/othervm -XX:+UseConcMarkSweepGC -Xmx64m jdk.jfr.event.gc.detailed.TestStressAllocationGCEventsWithCMS
  */
--- a/test/jdk/jdk/jfr/event/gc/detailed/TestStressAllocationGCEventsWithParNew.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/jdk/jdk/jfr/event/gc/detailed/TestStressAllocationGCEventsWithParNew.java	Thu Jun 07 17:38:34 2018 -0700
@@ -26,7 +26,7 @@
 
 /*
  * @test
- * @requires vm.gc == "null"
+ * @requires vm.gc == "null" & !vm.graal.enabled
  * @library /test/lib /test/jdk
  * @run main/othervm -XX:+UseConcMarkSweepGC -Xmx64m jdk.jfr.event.gc.detailed.TestStressAllocationGCEventsWithParNew
  */
--- a/test/jdk/jdk/jfr/event/gc/detailed/TestStressBigAllocationGCEventsWithCMS.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/jdk/jdk/jfr/event/gc/detailed/TestStressBigAllocationGCEventsWithCMS.java	Thu Jun 07 17:38:34 2018 -0700
@@ -26,7 +26,7 @@
 
 /*
  * @test
- * @requires vm.gc == "null" | vm.gc == "ConcMarkSweep"
+ * @requires (vm.gc == "null" | vm.gc == "ConcMarkSweep") & !vm.graal.enabled
  * @library /test/lib /test/jdk
  * @run main/othervm -XX:+UseConcMarkSweepGC -Xmx256m jdk.jfr.event.gc.detailed.TestStressBigAllocationGCEventsWithCMS 1048576
  */
--- a/test/jdk/jdk/jfr/event/gc/detailed/TestStressBigAllocationGCEventsWithParNew.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/jdk/jdk/jfr/event/gc/detailed/TestStressBigAllocationGCEventsWithParNew.java	Thu Jun 07 17:38:34 2018 -0700
@@ -26,7 +26,7 @@
 
 /*
  * @test
- * @requires vm.gc == "null"
+ * @requires vm.gc == "null" & !vm.graal.enabled
  * @library /test/lib /test/jdk
  * @run main/othervm -XX:+UseConcMarkSweepGC -Xmx256m jdk.jfr.event.gc.detailed.TestStressBigAllocationGCEventsWithParNew 1048576
  */
--- a/test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryEventConcurrentCMS.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryEventConcurrentCMS.java	Thu Jun 07 17:38:34 2018 -0700
@@ -38,7 +38,7 @@
 /*
  * @test
  * @key jfr
- * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null)
+ * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null) & !vm.graal.enabled
  *           & vm.opt.ExplicitGCInvokesConcurrent != false
  * @library /test/lib /test/jdk
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps -XX:+UseConcMarkSweepGC -XX:+ExplicitGCInvokesConcurrent jdk.jfr.event.gc.heapsummary.TestHeapSummaryEventConcurrentCMS
--- a/test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryEventParNewCMS.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryEventParNewCMS.java	Thu Jun 07 17:38:34 2018 -0700
@@ -29,7 +29,7 @@
 /*
  * @test
  * @key jfr
- * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null)
+ * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null) & !vm.graal.enabled
  *           & vm.opt.ExplicitGCInvokesConcurrent != true
  * @library /test/lib /test/jdk
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps -XX:+UseConcMarkSweepGC jdk.jfr.event.gc.heapsummary.TestHeapSummaryEventParNewCMS
--- a/test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithCMSConcurrent.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithCMSConcurrent.java	Thu Jun 07 17:38:34 2018 -0700
@@ -29,7 +29,7 @@
 /*
  * @test
  * @key jfr
- * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null)
+ * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null) & !vm.graal.enabled
  *           & vm.opt.ExplicitGCInvokesConcurrent != false
  * @library /test/lib /test/jdk
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps -XX:+UseConcMarkSweepGC -XX:+ExplicitGCInvokesConcurrent -XX:MarkSweepDeadRatio=0 -XX:-UseCompressedOops -XX:+IgnoreUnrecognizedVMOptions jdk.jfr.event.gc.objectcount.TestObjectCountAfterGCEventWithCMSConcurrent
--- a/test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithCMSMarkSweep.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithCMSMarkSweep.java	Thu Jun 07 17:38:34 2018 -0700
@@ -29,7 +29,7 @@
 /*
  * @test
  * @key jfr
- * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null)
+ * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null) & !vm.graal.enabled
  *           & vm.opt.ExplicitGCInvokesConcurrent != true
  * @library /test/lib /test/jdk
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps -XX:+UseConcMarkSweepGC -XX:MarkSweepDeadRatio=0 -XX:-UseCompressedOops -XX:+IgnoreUnrecognizedVMOptions jdk.jfr.event.gc.objectcount.TestObjectCountAfterGCEventWithCMSMarkSweep
--- a/test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithCMSConcurrent.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithCMSConcurrent.java	Thu Jun 07 17:38:34 2018 -0700
@@ -29,7 +29,7 @@
 /*
  * @test
  * @key jfr
- * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null)
+ * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null) & !vm.graal.enabled
  *           & vm.opt.ExplicitGCInvokesConcurrent != false
  * @library /test/lib /test/jdk
  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps -Xlog:gc+heap=trace,gc*=debug -XX:+UseConcMarkSweepGC -XX:+ExplicitGCInvokesConcurrent jdk.jfr.event.gc.refstat.TestRefStatEventWithCMSConcurrent
--- a/test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithCMSMarkSweep.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithCMSMarkSweep.java	Thu Jun 07 17:38:34 2018 -0700
@@ -29,7 +29,7 @@
 /*
  * @test
  * @key jfr
- * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null)
+ * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null) & !vm.graal.enabled
  *           & vm.opt.ExplicitGCInvokesConcurrent != true
  * @library /test/lib /test/jdk
  * @run main/othervm  -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps -Xlog:gc+heap=trace,gc*=debug -XX:+UseConcMarkSweepGC jdk.jfr.event.gc.refstat.TestRefStatEventWithCMSMarkSweep
--- a/test/jdk/jdk/jfr/event/gc/stacktrace/TestConcMarkSweepAllocationPendingStackTrace.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/jdk/jdk/jfr/event/gc/stacktrace/TestConcMarkSweepAllocationPendingStackTrace.java	Thu Jun 07 17:38:34 2018 -0700
@@ -28,7 +28,7 @@
  * @test
  * @key jfr
  *
- * @requires vm.gc == "null" | vm.gc == "ConcMarkSweep"
+ * @requires (vm.gc == "null" | vm.gc == "ConcMarkSweep") & !vm.graal.enabled
  * @library /test/lib /test/jdk
  * @run main/othervm -XX:MaxNewSize=10M -Xmx64M -XX:+UseConcMarkSweepGC -Xlog:gc* jdk.jfr.event.gc.stacktrace.TestConcMarkSweepAllocationPendingStackTrace
  */
--- a/test/jdk/jdk/jfr/event/gc/stacktrace/TestMetaspaceConcMarkSweepGCAllocationPendingStackTrace.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/jdk/jdk/jfr/event/gc/stacktrace/TestMetaspaceConcMarkSweepGCAllocationPendingStackTrace.java	Thu Jun 07 17:38:34 2018 -0700
@@ -28,7 +28,7 @@
  * @test
  * @key jfr
  *
- * @requires vm.gc == "null" | vm.gc == "ConcMarkSweep"
+ * @requires (vm.gc == "null" | vm.gc == "ConcMarkSweep") & !vm.graal.enabled
  * @requires !(vm.compMode == "Xcomp" & os.arch == "aarch64")
  * @library /test/lib /test/jdk
  * @run main/othervm -XX:+UseConcMarkSweepGC -XX:MaxMetaspaceSize=64M -Xlog:gc* jdk.jfr.event.gc.stacktrace.TestMetaspaceConcMarkSweepGCAllocationPendingStackTrace
--- a/test/jdk/jdk/jfr/event/gc/stacktrace/TestParNewAllocationPendingStackTrace.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/jdk/jdk/jfr/event/gc/stacktrace/TestParNewAllocationPendingStackTrace.java	Thu Jun 07 17:38:34 2018 -0700
@@ -28,7 +28,7 @@
  * @test
  * @key jfr
  *
- * @requires vm.gc == "null" | vm.gc == "ConcMarkSweep"
+ * @requires (vm.gc == "null" | vm.gc == "ConcMarkSweep") & !vm.graal.enabled
  * @library /test/lib /test/jdk
  * @run main/othervm -XX:+UseConcMarkSweepGC -Xlog:gc* -XX:+FlightRecorder jdk.jfr.event.gc.stacktrace.TestParNewAllocationPendingStackTrace
  */
--- a/test/jdk/jdk/jfr/event/oldobject/TestCMS.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/jdk/jdk/jfr/event/oldobject/TestCMS.java	Thu Jun 07 17:38:34 2018 -0700
@@ -37,7 +37,7 @@
 /*
  * @test
  * @key jfr
- * @requires vm.gc == "null"
+ * @requires vm.gc == "null" & !vm.graal.enabled
  * @summary Test leak profiler with CMS GC
  * @library /test/lib /test/jdk
  * @modules jdk.jfr/jdk.jfr.internal.test
--- a/test/jdk/jdk/jfr/event/runtime/TestModuleEvents.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/jdk/jdk/jfr/event/runtime/TestModuleEvents.java	Thu Jun 07 17:38:34 2018 -0700
@@ -40,6 +40,7 @@
  * @test
  * @summary Tests the JFR events related to modules
  * @key jfr
+ * @requires !vm.graal.enabled
  * @library /test/lib
  * @run main/othervm --limit-modules java.base,jdk.jfr jdk.jfr.event.runtime.TestModuleEvents
  */
--- a/test/jtreg-ext/requires/VMProps.java	Thu Jun 07 17:10:23 2018 -0700
+++ b/test/jtreg-ext/requires/VMProps.java	Thu Jun 07 17:38:34 2018 -0700
@@ -36,6 +36,7 @@
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
+import sun.hotspot.code.Compiler;
 import sun.hotspot.cpuinfo.CPUInfo;
 import sun.hotspot.gc.GC;
 import sun.hotspot.WhiteBox;
@@ -344,33 +345,7 @@
      * @return true if Graal is used as JIT compiler.
      */
     protected String isGraalEnabled() {
-        // Graal is enabled if following conditions are true:
-        // - we are not in Interpreter mode
-        // - UseJVMCICompiler flag is true
-        // - jvmci.Compiler variable is equal to 'graal'
-        // - TieredCompilation is not used or TieredStopAtLevel is greater than 3
-
-        Boolean useCompiler = WB.getBooleanVMFlag("UseCompiler");
-        if (useCompiler == null || !useCompiler)
-            return "false";
-
-        Boolean useJvmciComp = WB.getBooleanVMFlag("UseJVMCICompiler");
-        if (useJvmciComp == null || !useJvmciComp)
-            return "false";
-
-        // This check might be redundant but let's keep it for now.
-        String jvmciCompiler = System.getProperty("jvmci.Compiler");
-        if (jvmciCompiler == null || !jvmciCompiler.equals("graal")) {
-            return "false";
-        }
-
-        Boolean tieredCompilation = WB.getBooleanVMFlag("TieredCompilation");
-        Long compLevel = WB.getIntxVMFlag("TieredStopAtLevel");
-        // if TieredCompilation is enabled and compilation level is <= 3 then no Graal is used
-        if (tieredCompilation != null && tieredCompilation && compLevel != null && compLevel <= 3)
-            return "false";
-
-        return "true";
+        return Compiler.isGraalEnabled() ? "true" : "false";
     }
 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/lib/sun/hotspot/code/Compiler.java	Thu Jun 07 17:38:34 2018 -0700
@@ -0,0 +1,136 @@
+/*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.hotspot.code;
+
+import sun.hotspot.WhiteBox;
+
+/**
+ * API to obtain information about enabled JIT compilers
+ * retrieved from the VM with the WhiteBox API.
+ */
+public class Compiler {
+
+    private static final WhiteBox WB = WhiteBox.getWhiteBox();
+
+    /**
+     * Check if Graal is used as JIT compiler.
+     *
+     * Graal is enabled if following conditions are true:
+     * - we are not in Interpreter mode
+     * - UseJVMCICompiler flag is true
+     * - jvmci.Compiler variable is equal to 'graal'
+     * - TieredCompilation is not used or TieredStopAtLevel is greater than 3
+     * No need to check client mode because it set UseJVMCICompiler to false.
+     *
+     * @return true if Graal is used as JIT compiler.
+     */
+    public static boolean isGraalEnabled() {
+        Boolean useCompiler = WB.getBooleanVMFlag("UseCompiler");
+        if (useCompiler == null || !useCompiler) {
+            return false;
+        }
+        Boolean useJvmciComp = WB.getBooleanVMFlag("UseJVMCICompiler");
+        if (useJvmciComp == null || !useJvmciComp) {
+            return false;
+        }
+        // This check might be redundant but let's keep it for now.
+        String jvmciCompiler = System.getProperty("jvmci.Compiler");
+        if (jvmciCompiler == null || !jvmciCompiler.equals("graal")) {
+            return false;
+        }
+
+        Boolean tieredCompilation = WB.getBooleanVMFlag("TieredCompilation");
+        Long compLevel = WB.getIntxVMFlag("TieredStopAtLevel");
+        // if TieredCompilation is enabled and compilation level is <= 3 then no Graal is used
+        if (tieredCompilation != null && tieredCompilation &&
+            compLevel != null && compLevel <= 3) {
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * Check if C2 is used as JIT compiler.
+     *
+     * C2 is enabled if following conditions are true:
+     * - we are not in Interpreter mode
+     * - we are in Server compilation mode
+     * - TieredCompilation is not used or TieredStopAtLevel is greater than 3
+     * - Graal is not used
+     *
+     * @return true if C2 is used as JIT compiler.
+     */
+    public static boolean isC2Enabled() {
+        Boolean useCompiler = WB.getBooleanVMFlag("UseCompiler");
+        if (useCompiler == null || !useCompiler) {
+            return false;
+        }
+        Boolean serverMode = WB.getBooleanVMFlag("ProfileInterpreter");
+        if (serverMode == null || !serverMode) {
+            return false;
+        }
+
+        Boolean tieredCompilation = WB.getBooleanVMFlag("TieredCompilation");
+        Long compLevel = WB.getIntxVMFlag("TieredStopAtLevel");
+        // if TieredCompilation is enabled and compilation level is <= 3 then no Graal is used
+        if (tieredCompilation != null && tieredCompilation &&
+            compLevel != null && compLevel <= 3) {
+            return false;
+        }
+
+        if (isGraalEnabled()) {
+            return false;
+        }
+
+        return true;
+    }
+
+    /*
+     * Check if C1 is used as JIT compiler.
+     *
+     * C1 is enabled if following conditions are true:
+     * - we are not in Interpreter mode
+     * - we are not in Server compilation mode
+     * - TieredCompilation is used in Server mode
+     *
+     * @return true if C1 is used as JIT compiler.
+     */
+    public static boolean isC1Enabled() {
+        Boolean useCompiler = WB.getBooleanVMFlag("UseCompiler");
+        if (useCompiler == null || !useCompiler) {
+            return false;
+        }
+        Boolean serverMode = WB.getBooleanVMFlag("ProfileInterpreter");
+        if (serverMode == null || !serverMode) {
+            return true; // Client mode
+        }
+
+        Boolean tieredCompilation = WB.getBooleanVMFlag("TieredCompilation");
+        // C1 is not used in server mode if TieredCompilation is off.
+        if (tieredCompilation != null && !tieredCompilation) {
+            return false;
+        }
+        return true;
+    }
+}