comparison src/share/vm/runtime/advancedThresholdPolicy.cpp @ 3790:6f6e91603a45

7058689: Tiered: Reprofiling doesn't happen in presence of level 4 OSR methods Summary: Take into account current state of profiling before believing that existing higher level versions are valid Reviewed-by: kvn, never
author iveresov
date Fri, 01 Jul 2011 10:35:54 -0700
parents 97b64f73103b
children 2c359f27615c
comparison
equal deleted inserted replaced
3789:7889bbcc7f88 3790:6f6e91603a45
376 } 376 }
377 return next_level; 377 return next_level;
378 } 378 }
379 379
380 // Determine if a method should be compiled with a normal entry point at a different level. 380 // Determine if a method should be compiled with a normal entry point at a different level.
381 CompLevel AdvancedThresholdPolicy::call_event(methodOop method, CompLevel cur_level) { 381 CompLevel AdvancedThresholdPolicy::call_event(methodOop method, CompLevel cur_level) {
382 CompLevel osr_level = (CompLevel) method->highest_osr_comp_level(); 382 CompLevel osr_level = MIN2((CompLevel) method->highest_osr_comp_level(),
383 common(&AdvancedThresholdPolicy::loop_predicate, method, cur_level));
383 CompLevel next_level = common(&AdvancedThresholdPolicy::call_predicate, method, cur_level); 384 CompLevel next_level = common(&AdvancedThresholdPolicy::call_predicate, method, cur_level);
384 385
385 // If OSR method level is greater than the regular method level, the levels should be 386 // If OSR method level is greater than the regular method level, the levels should be
386 // equalized by raising the regular method level in order to avoid OSRs during each 387 // equalized by raising the regular method level in order to avoid OSRs during each
387 // invocation of the method. 388 // invocation of the method.
398 return next_level; 399 return next_level;
399 } 400 }
400 401
401 // Determine if we should do an OSR compilation of a given method. 402 // Determine if we should do an OSR compilation of a given method.
402 CompLevel AdvancedThresholdPolicy::loop_event(methodOop method, CompLevel cur_level) { 403 CompLevel AdvancedThresholdPolicy::loop_event(methodOop method, CompLevel cur_level) {
404 CompLevel next_level = common(&AdvancedThresholdPolicy::loop_predicate, method, cur_level);
403 if (cur_level == CompLevel_none) { 405 if (cur_level == CompLevel_none) {
404 // If there is a live OSR method that means that we deopted to the interpreter 406 // If there is a live OSR method that means that we deopted to the interpreter
405 // for the transition. 407 // for the transition.
406 CompLevel osr_level = (CompLevel)method->highest_osr_comp_level(); 408 CompLevel osr_level = MIN2((CompLevel)method->highest_osr_comp_level(), next_level);
407 if (osr_level > CompLevel_none) { 409 if (osr_level > CompLevel_none) {
408 return osr_level; 410 return osr_level;
409 } 411 }
410 } 412 }
411 return common(&AdvancedThresholdPolicy::loop_predicate, method, cur_level); 413 return next_level;
412 } 414 }
413 415
414 // Update the rate and submit compile 416 // Update the rate and submit compile
415 void AdvancedThresholdPolicy::submit_compile(methodHandle mh, int bci, CompLevel level, TRAPS) { 417 void AdvancedThresholdPolicy::submit_compile(methodHandle mh, int bci, CompLevel level, TRAPS) {
416 int hot_count = (bci == InvocationEntryBci) ? mh->invocation_count() : mh->backedge_count(); 418 int hot_count = (bci == InvocationEntryBci) ? mh->invocation_count() : mh->backedge_count();