< prev index next >

test/hotspot/jtreg/compiler/lib/ir_framework/test/TestVM.java

Print this page
*** 99,10 ***
--- 99,11 ---
      private static final boolean SHUFFLE_TESTS = Boolean.parseBoolean(System.getProperty("ShuffleTests", "true"));
      // Use separate flag as VERIFY_IR could have been set by user but due to other flags it was disabled by flag VM.
      private static final boolean PRINT_VALID_IR_RULES = Boolean.getBoolean("ShouldDoIRVerification");
      protected static final long PER_METHOD_TRAP_LIMIT = (Long)WHITE_BOX.getVMFlag("PerMethodTrapLimit");
      protected static final boolean PROFILE_INTERPRETER = (Boolean)WHITE_BOX.getVMFlag("ProfileInterpreter");
+     protected static final boolean DEOPT_BARRIERS_ALOT = (Boolean)WHITE_BOX.getVMFlag("DeoptimizeNMethodBarriersALot");
      private static final boolean FLIP_C1_C2 = Boolean.getBoolean("FlipC1C2");
      private static final boolean IGNORE_COMPILER_CONTROLS = Boolean.getBoolean("IgnoreCompilerControls");
  
      private final HashMap<Method, DeclaredTest> declaredTests = new HashMap<>();
      private final List<AbstractTest> allTests = new ArrayList<>();

*** 248,12 ***
          checkForcedCompilationsCompleted();
          runTests();
      }
  
      private void setupTests() {
!         for (Class<?> clazz : testClass.getDeclaredClasses()) {
!             checkAnnotationsInClass(clazz, "inner");
          }
          if (DUMP_REPLAY) {
              addReplay();
          }
          // Make sure to first setup test methods and make them non-inlineable and only then process compile commands.
--- 249,15 ---
          checkForcedCompilationsCompleted();
          runTests();
      }
  
      private void setupTests() {
!         // TODO remove this once JDK-8273591 is fixed
!         if (!IGNORE_COMPILER_CONTROLS) {
+             for (Class<?> clazz : testClass.getDeclaredClasses()) {
+                 checkAnnotationsInClass(clazz, "inner");
+             }
          }
          if (DUMP_REPLAY) {
              addReplay();
          }
          // Make sure to first setup test methods and make them non-inlineable and only then process compile commands.

*** 889,28 ***
      public static boolean isCompiledAtLevel(Method m, CompLevel compLevel) {
          return compiledAtLevel(m, compLevel) == TriState.Yes;
      }
  
      public static void assertDeoptimizedByC1(Method m) {
!         if (notUnstableDeoptAssertion(m, CompLevel.C1_SIMPLE)) {
!             TestRun.check(compiledByC1(m) != TriState.Yes || PER_METHOD_TRAP_LIMIT == 0 || !PROFILE_INTERPRETER,
-                           m + " should have been deoptimized by C1");
          }
      }
  
      public static void assertDeoptimizedByC2(Method m) {
!         if (notUnstableDeoptAssertion(m, CompLevel.C2)) {
!             TestRun.check(compiledByC2(m) != TriState.Yes || PER_METHOD_TRAP_LIMIT == 0 || !PROFILE_INTERPRETER,
-                           m + " should have been deoptimized by C2");
          }
      }
  
      /**
       * Some VM flags could make the deopt assertions unstable.
       */
!     private static boolean notUnstableDeoptAssertion(Method m, CompLevel level) {
          return (USE_COMPILER && !XCOMP && !IGNORE_COMPILER_CONTROLS && !TEST_C1 &&
                  (!EXCLUDE_RANDOM || WHITE_BOX.isMethodCompilable(m, level.getValue(), false)));
      }
  
      public static void assertCompiledByC1(Method m) {
          TestRun.check(compiledByC1(m) != TriState.No, m + " should have been C1 compiled");
--- 893,27 ---
      public static boolean isCompiledAtLevel(Method m, CompLevel compLevel) {
          return compiledAtLevel(m, compLevel) == TriState.Yes;
      }
  
      public static void assertDeoptimizedByC1(Method m) {
!         if (isStableDeopt(m, CompLevel.C1_SIMPLE)) {
!             TestRun.check(compiledByC1(m) != TriState.Yes, m + " should have been deoptimized by C1");
          }
      }
  
      public static void assertDeoptimizedByC2(Method m) {
!         if (isStableDeopt(m, CompLevel.C2)) {
!             TestRun.check(compiledByC2(m) != TriState.Yes, m + " should have been deoptimized by C2");
          }
      }
  
      /**
       * Some VM flags could make the deopt assertions unstable.
       */
!     public static boolean isStableDeopt(Method m, CompLevel level) {
          return (USE_COMPILER && !XCOMP && !IGNORE_COMPILER_CONTROLS && !TEST_C1 &&
+                 PER_METHOD_TRAP_LIMIT != 0 && PROFILE_INTERPRETER && !DEOPT_BARRIERS_ALOT &&
                  (!EXCLUDE_RANDOM || WHITE_BOX.isMethodCompilable(m, level.getValue(), false)));
      }
  
      public static void assertCompiledByC1(Method m) {
          TestRun.check(compiledByC1(m) != TriState.No, m + " should have been C1 compiled");

*** 962,11 ***
                      return TriState.Yes;
                  }
                  default -> throw new TestRunException("compiledAtLevel() should not be called with " + level);
              }
          }
!         if (!USE_COMPILER || XCOMP || TEST_C1 || IGNORE_COMPILER_CONTROLS || FLIP_C1_C2 ||
              (EXCLUDE_RANDOM && !WHITE_BOX.isMethodCompilable(m, level.getValue(), false))) {
              return TriState.Maybe;
          }
          return TriState.No;
      }
--- 965,11 ---
                      return TriState.Yes;
                  }
                  default -> throw new TestRunException("compiledAtLevel() should not be called with " + level);
              }
          }
!         if (!USE_COMPILER || XCOMP || TEST_C1 || IGNORE_COMPILER_CONTROLS || FLIP_C1_C2 || DEOPT_BARRIERS_ALOT ||
              (EXCLUDE_RANDOM && !WHITE_BOX.isMethodCompilable(m, level.getValue(), false))) {
              return TriState.Maybe;
          }
          return TriState.No;
      }
< prev index next >