test/hotspot/jtreg/compiler/profiling/TestTypeProfiling.java
changeset 51073 34696f3aa22b
parent 48183 ee8e37f85775
child 52005 4236fa9582bb
equal deleted inserted replaced
51072:6a037fd949e4 51073:34696f3aa22b
   115         if (!WHITE_BOX.isMethodCompiled(method)) {
   115         if (!WHITE_BOX.isMethodCompiled(method)) {
   116             throw new RuntimeException(method.getName() + " is not compiled");
   116             throw new RuntimeException(method.getName() + " is not compiled");
   117         }
   117         }
   118 
   118 
   119         // should deoptimize for speculative type check
   119         // should deoptimize for speculative type check
       
   120         // Intepreter will also add actual type check trap information into MDO
       
   121         // when it throw ClassCastException
   120         if (!deoptimize(method, src_obj)) {
   122         if (!deoptimize(method, src_obj)) {
   121             throw new RuntimeException(method.getName() + " is not deoptimized");
   123             throw new RuntimeException(method.getName() + " is not deoptimized");
   122         }
   124         }
   123 
   125 
   124         // compile again
   126         // compile again
   125         WHITE_BOX.enqueueMethodForCompilation(method, CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION);
   127         // c2 will generate throw instead of uncommon trap because
   126         if (!WHITE_BOX.isMethodCompiled(method)) {
   128         // actual type check trap information is present in MDO
   127             throw new RuntimeException(method.getName() + " is not recompiled");
       
   128         }
       
   129 
       
   130         // should deoptimize for actual type check
       
   131         if (!deoptimize(method, src_obj)) {
       
   132             throw new RuntimeException(method.getName() + " is not deoptimized (should deoptimize for actual type check)");
       
   133         }
       
   134 
       
   135         // compile once again
       
   136         WHITE_BOX.enqueueMethodForCompilation(method, CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION);
   129         WHITE_BOX.enqueueMethodForCompilation(method, CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION);
   137         if (!WHITE_BOX.isMethodCompiled(method)) {
   130         if (!WHITE_BOX.isMethodCompiled(method)) {
   138             throw new RuntimeException(method.getName() + " is not recompiled");
   131             throw new RuntimeException(method.getName() + " is not recompiled");
   139         }
   132         }
   140 
   133