8078444: compiler/arraycopy/TestArrayCopyNoInitDeopt.java fails with exception 'm2 not deoptimized'
authorroland
Thu, 23 Apr 2015 16:38:08 +0200
changeset 30307 9769a4813f52
parent 30306 83fe12c6f39b
child 30308 2c51ee9bffe1
8078444: compiler/arraycopy/TestArrayCopyNoInitDeopt.java fails with exception 'm2 not deoptimized' Summary: some platform don't have speculative types Reviewed-by: kvn
hotspot/test/compiler/arraycopy/TestArrayCopyNoInitDeopt.java
--- a/hotspot/test/compiler/arraycopy/TestArrayCopyNoInitDeopt.java	Mon Apr 27 11:01:29 2015 +0200
+++ b/hotspot/test/compiler/arraycopy/TestArrayCopyNoInitDeopt.java	Thu Apr 23 16:38:08 2015 +0200
@@ -116,44 +116,46 @@
                 throw new RuntimeException("m1 deoptimized again");
             }
 
-            // Same test as above but with speculative types
+            if (WHITE_BOX.getUintxVMFlag("TypeProfileLevel") == 20) {
+                // Same test as above but with speculative types
 
-            // Warm up & make sure we collect type profiling
-            for (int i = 0; i < 20000; i++) {
-                m2(src);
-            }
+                // Warm up & make sure we collect type profiling
+                for (int i = 0; i < 20000; i++) {
+                    m2(src);
+                }
 
-            // And make sure m2 is compiled by C2
-            WHITE_BOX.enqueueMethodForCompilation(method_m2, CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION);
+                // And make sure m2 is compiled by C2
+                WHITE_BOX.enqueueMethodForCompilation(method_m2, CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION);
 
-            if (!WHITE_BOX.isMethodCompiled(method_m2)) {
-                throw new RuntimeException("m2 not compiled");
-            }
+                if (!WHITE_BOX.isMethodCompiled(method_m2)) {
+                    throw new RuntimeException("m2 not compiled");
+                }
 
-            // should deoptimize for speculative type check
-            if (!deoptimize(method_m2, src_obj)) {
-                throw new RuntimeException("m2 not deoptimized");
-            }
+                // should deoptimize for speculative type check
+                if (!deoptimize(method_m2, src_obj)) {
+                    throw new RuntimeException("m2 not deoptimized");
+                }
 
-            WHITE_BOX.enqueueMethodForCompilation(method_m2, CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION);
+                WHITE_BOX.enqueueMethodForCompilation(method_m2, CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION);
 
-            if (!WHITE_BOX.isMethodCompiled(method_m2)) {
-                throw new RuntimeException("m2 not recompiled");
-            }
+                if (!WHITE_BOX.isMethodCompiled(method_m2)) {
+                    throw new RuntimeException("m2 not recompiled");
+                }
 
-            // should deoptimize for actual type check
-            if (!deoptimize(method_m2, src_obj)) {
-                throw new RuntimeException("m2 not deoptimized");
-            }
+                // should deoptimize for actual type check
+                if (!deoptimize(method_m2, src_obj)) {
+                    throw new RuntimeException("m2 not deoptimized");
+                }
 
-            WHITE_BOX.enqueueMethodForCompilation(method_m2, CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION);
+                WHITE_BOX.enqueueMethodForCompilation(method_m2, CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION);
 
-            if (!WHITE_BOX.isMethodCompiled(method_m2)) {
-                throw new RuntimeException("m2 not recompiled");
-            }
+                if (!WHITE_BOX.isMethodCompiled(method_m2)) {
+                    throw new RuntimeException("m2 not recompiled");
+                }
 
-            if (deoptimize(method_m2, src_obj)) {
-                throw new RuntimeException("m2 deoptimized again");
+                if (deoptimize(method_m2, src_obj)) {
+                    throw new RuntimeException("m2 deoptimized again");
+                }
             }
         }
     }