test/hotspot/jtreg/compiler/profiling/TestTypeProfiling.java
changeset 51073 34696f3aa22b
parent 48183 ee8e37f85775
child 52005 4236fa9582bb
--- a/test/hotspot/jtreg/compiler/profiling/TestTypeProfiling.java	Thu Jul 12 11:24:10 2018 -0700
+++ b/test/hotspot/jtreg/compiler/profiling/TestTypeProfiling.java	Thu Jul 12 11:57:06 2018 -0700
@@ -117,22 +117,15 @@
         }
 
         // should deoptimize for speculative type check
+        // Intepreter will also add actual type check trap information into MDO
+        // when it throw ClassCastException
         if (!deoptimize(method, src_obj)) {
             throw new RuntimeException(method.getName() + " is not deoptimized");
         }
 
         // compile again
-        WHITE_BOX.enqueueMethodForCompilation(method, CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION);
-        if (!WHITE_BOX.isMethodCompiled(method)) {
-            throw new RuntimeException(method.getName() + " is not recompiled");
-        }
-
-        // should deoptimize for actual type check
-        if (!deoptimize(method, src_obj)) {
-            throw new RuntimeException(method.getName() + " is not deoptimized (should deoptimize for actual type check)");
-        }
-
-        // compile once again
+        // c2 will generate throw instead of uncommon trap because
+        // actual type check trap information is present in MDO
         WHITE_BOX.enqueueMethodForCompilation(method, CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION);
         if (!WHITE_BOX.isMethodCompiled(method)) {
             throw new RuntimeException(method.getName() + " is not recompiled");