src/share/vm/runtime/simpleThresholdPolicy.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File JDK-8015774 Sdiff src/share/vm/runtime

src/share/vm/runtime/simpleThresholdPolicy.cpp

Print this page




 313       break;
 314     case CompLevel_limited_profile:
 315     case CompLevel_full_profile:
 316       {
 317         MethodData* mdo = method->method_data();
 318         if (mdo != NULL) {
 319           if (mdo->would_profile()) {
 320             int mdo_i = mdo->invocation_count_delta();
 321             int mdo_b = mdo->backedge_count_delta();
 322             if ((this->*p)(mdo_i, mdo_b, cur_level)) {
 323               next_level = CompLevel_full_optimization;
 324             }
 325           } else {
 326             next_level = CompLevel_full_optimization;
 327           }
 328         }
 329       }
 330       break;
 331     }
 332   }
 333   return MIN2(next_level, (CompLevel)TieredStopAtLevel);






 334 }
 335 
 336 // Determine if a method should be compiled with a normal entry point at a different level.
 337 CompLevel SimpleThresholdPolicy::call_event(Method* method,  CompLevel cur_level) {
 338   CompLevel osr_level = MIN2((CompLevel) method->highest_osr_comp_level(),
 339                              common(&SimpleThresholdPolicy::loop_predicate, method, cur_level));
 340   CompLevel next_level = common(&SimpleThresholdPolicy::call_predicate, method, cur_level);
 341 
 342   // If OSR method level is greater than the regular method level, the levels should be
 343   // equalized by raising the regular method level in order to avoid OSRs during each
 344   // invocation of the method.
 345   if (osr_level == CompLevel_full_optimization && cur_level == CompLevel_full_profile) {
 346     MethodData* mdo = method->method_data();
 347     guarantee(mdo != NULL, "MDO should not be NULL");
 348     if (mdo->invocation_count() >= 1) {
 349       next_level = CompLevel_full_optimization;
 350     }
 351   } else {
 352     next_level = MAX2(osr_level, next_level);
 353   }




 313       break;
 314     case CompLevel_limited_profile:
 315     case CompLevel_full_profile:
 316       {
 317         MethodData* mdo = method->method_data();
 318         if (mdo != NULL) {
 319           if (mdo->would_profile()) {
 320             int mdo_i = mdo->invocation_count_delta();
 321             int mdo_b = mdo->backedge_count_delta();
 322             if ((this->*p)(mdo_i, mdo_b, cur_level)) {
 323               next_level = CompLevel_full_optimization;
 324             }
 325           } else {
 326             next_level = CompLevel_full_optimization;
 327           }
 328         }
 329       }
 330       break;
 331     }
 332   }
 333 
 334   next_level = MIN2(next_level, (CompLevel)TieredStopAtLevel);
 335   if (CodeCache::is_full(CodeCache::get_code_blob_type(next_level))) {
 336     // The CodeHeap for next_level is full, stay at current level
 337     return cur_level;
 338   }
 339   return next_level;
 340 }
 341 
 342 // Determine if a method should be compiled with a normal entry point at a different level.
 343 CompLevel SimpleThresholdPolicy::call_event(Method* method,  CompLevel cur_level) {
 344   CompLevel osr_level = MIN2((CompLevel) method->highest_osr_comp_level(),
 345                              common(&SimpleThresholdPolicy::loop_predicate, method, cur_level));
 346   CompLevel next_level = common(&SimpleThresholdPolicy::call_predicate, method, cur_level);
 347 
 348   // If OSR method level is greater than the regular method level, the levels should be
 349   // equalized by raising the regular method level in order to avoid OSRs during each
 350   // invocation of the method.
 351   if (osr_level == CompLevel_full_optimization && cur_level == CompLevel_full_profile) {
 352     MethodData* mdo = method->method_data();
 353     guarantee(mdo != NULL, "MDO should not be NULL");
 354     if (mdo->invocation_count() >= 1) {
 355       next_level = CompLevel_full_optimization;
 356     }
 357   } else {
 358     next_level = MAX2(osr_level, next_level);
 359   }


src/share/vm/runtime/simpleThresholdPolicy.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File