changeset 6861:564d97997064

8060454: [TESTBUG] Whitebox tests fail with -XX:CompileThreshold=100 Summary: Move the call to 'waitAndDeoptimize' from the warmup methods to the osr triggering methods to make sure that no non-osr compilation is in the queue after warmup. Reviewed-by: kvn
author thartmann
date Fri, 17 Oct 2014 10:04:45 +0200
parents c88a4554854c
children d1e732bbe4e5
files test/compiler/whitebox/CompilerWhiteBoxTest.java
diffstat 1 files changed, 16 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/test/compiler/whitebox/CompilerWhiteBoxTest.java	Mon Oct 13 12:30:37 2014 +0200
+++ b/test/compiler/whitebox/CompilerWhiteBoxTest.java	Fri Oct 17 10:04:45 2014 +0200
@@ -541,7 +541,7 @@
          * @param e Executable
          * @throws Exception
          */
-        private static void waitAndDeoptimize(Executable e) throws Exception {
+        private static void waitAndDeoptimize(Executable e) {
             CompilerWhiteBoxTest.waitBackgroundCompilation(e);
             if (WhiteBox.getWhiteBox().isMethodQueuedForCompilation(e)) {
                 throw new RuntimeException(e + " must not be in queue");
@@ -565,8 +565,6 @@
             for (long i = 0; i < CompilerWhiteBoxTest.OSR_WARMUP; ++i) {
                 result += (int)m.invoke(helper, 1);
             }
-            // Deoptimize non-osr versions
-            waitAndDeoptimize(m);
             return result;
         }
 
@@ -584,8 +582,6 @@
             for (long i = 0; i < CompilerWhiteBoxTest.OSR_WARMUP; ++i) {
                 result += c.newInstance(null, 1).hashCode();
             }
-            // Deoptimize non-osr versions
-            waitAndDeoptimize(c);
             return result;
         }
 
@@ -634,6 +630,11 @@
         }
 
         private static int osrStaticMethod(long limit) {
+            if (limit != 1) {
+              // Make sure there is no compiled version after warmup
+              waitAndDeoptimize(OSR_STATIC);
+            }
+            // Trigger osr compilation
             int result = 0;
             for (long i = 0; i < limit; ++i) {
                 result += staticMethod();
@@ -642,6 +643,11 @@
         }
 
         private int osrMethod(long limit) {
+            if (limit != 1) {
+              // Make sure there is no compiled version after warmup
+              waitAndDeoptimize(OSR_METHOD);
+            }
+            // Trigger osr compilation
             int result = 0;
             for (long i = 0; i < limit; ++i) {
                 result += method();
@@ -658,6 +664,11 @@
 
         // for OSR constructor test case
         private Helper(Object o, long limit) {
+            if (limit != 1) {
+              // Make sure there is no compiled version after warmup
+              waitAndDeoptimize(OSR_CONSTRUCTOR);
+            }
+            // Trigger osr compilation
             int result = 0;
             for (long i = 0; i < limit; ++i) {
                 result += method();