< prev index next >

test/hotspot/jtreg/compiler/valhalla/valuetypes/ValueTypeTest.java

Print this page

@@ -82,18 +82,21 @@
 @interface Warmup {
     int value();
 }
 
 public abstract class ValueTypeTest {
+    // Run "jtreg -Dtest.c1=true" to enable experimental C1 testing.
+    static final boolean TEST_C1 = Boolean.getBoolean("test.c1");
+
     // Random test values
     public static final int  rI = Utils.getRandomInstance().nextInt() % 1000;
     public static final long rL = Utils.getRandomInstance().nextLong() % 1000;
 
     // User defined settings
     private static final boolean PRINT_GRAPH = true;
     private static final boolean PRINT_TIMES = Boolean.parseBoolean(System.getProperty("PrintTimes", "false"));
-    private static       boolean VERIFY_IR = Boolean.parseBoolean(System.getProperty("VerifyIR", "true"));
+    private static       boolean VERIFY_IR = Boolean.parseBoolean(System.getProperty("VerifyIR", "true")) && (!TEST_C1);
     private static final boolean VERIFY_VM = Boolean.parseBoolean(System.getProperty("VerifyVM", "false"));
     private static final String SCENARIOS = System.getProperty("Scenarios", "");
     private static final String TESTLIST = System.getProperty("Testlist", "");
     private static final String EXCLUDELIST = System.getProperty("Exclude", "");
     private static final int WARMUP = Integer.parseInt(System.getProperty("Warmup", "251"));

@@ -123,11 +126,11 @@
     protected static final boolean ValueTypePassFieldsAsArgs = (Boolean)WHITE_BOX.getVMFlag("ValueTypePassFieldsAsArgs");
     protected static final boolean ValueTypeArrayFlatten = (Boolean)WHITE_BOX.getVMFlag("ValueArrayFlatten");
     protected static final boolean ValueTypeReturnedAsFields = (Boolean)WHITE_BOX.getVMFlag("ValueTypeReturnedAsFields");
     protected static final boolean NullableValueTypes = (Boolean)WHITE_BOX.getVMFlag("NullableValueTypes");
     protected static final int COMP_LEVEL_ANY = -2;
-    protected static final int COMP_LEVEL_FULL_OPTIMIZATION = 4;
+    protected static final int COMP_LEVEL_FULL_OPTIMIZATION = TEST_C1 ? 1 : 4;
     protected static final Hashtable<String, Method> tests = new Hashtable<String, Method>();
     protected static final boolean USE_COMPILER = WHITE_BOX.getBooleanVMFlag("UseCompiler");
     protected static final boolean PRINT_IDEAL  = WHITE_BOX.getBooleanVMFlag("PrintIdeal");
     protected static final boolean XCOMP = Platform.isComp();
 

@@ -168,18 +171,28 @@
     /**
      * Override getNumScenarios and getVMParameters if you want to run with more than
      * the 5 built-in scenarios
      */
     public int getNumScenarios() {
+        if (TEST_C1) {
+            return 1;
+        } else {
         return 5;
     }
+    }
 
     /**
      * VM paramaters for the 5 built-in test scenarios. If your test needs to append
      * extra parameters for (some of) these scenarios, override getExtraVMParameters().
      */
     public String[] getVMParameters(int scenario) {
+        if (TEST_C1) {
+            return new String[] {
+                    "-XX:+EnableValhallaC1",
+            };
+        }
+
         switch (scenario) {
         case 0: return new String[] {
                 "-XX:+AlwaysIncrementalInline",
                 "-XX:ValueArrayElemMaxFlatOops=-1",
                 "-XX:ValueArrayElemMaxFlatSize=-1",
< prev index next >