test/java/lang/invoke/LFCaching/LambdaFormTestCase.java

Print this page

        

@@ -93,10 +93,15 @@
         int failCounter = 0;
         long testCaseNum = testMethods.size();
         long iterations = Math.max(1, Helper.TEST_LIMIT / testCaseNum);
         System.out.printf("Number of iterations according to -DtestLimit is %d (%d cases)%n",
                 iterations, iterations * testCaseNum);
+        String mode = System.getProperty("java.vm.info");
+        if (mode.equals("compiled mode")) {
+            System.out.println("Number of iterations is limited to 1 because compiled mode is on");
+            iterations = 1;
+        } else {
         HotSpotDiagnosticMXBean hsDiagBean = ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class);
         long codeCacheSize = Long.parseLong(
                 hsDiagBean.getVMOption("ReservedCodeCacheSize").getValue());
         System.out.printf("Code cache size is %d bytes%n", codeCacheSize);
         long iterationsByCodeCacheSize = (long) (codeCacheSize

@@ -115,10 +120,11 @@
         if (iterations == 0) {
             System.out.println("Warning: code cache size is too small to provide at"
                     + " least one iteration! Test will try to do one iteration.");
             iterations = 1;
         }
+        }
         System.out.printf("Number of iterations is set to %d (%d cases)%n",
                 iterations, iterations * testCaseNum);
         System.out.flush();
         for (long i = 0; i < iterations; i++) {
             System.err.println(String.format("Iteration %d:", i));