equal
deleted
inserted
replaced
321 return next_level; |
321 return next_level; |
322 } |
322 } |
323 |
323 |
324 // Determine if a method should be compiled with a normal entry point at a different level. |
324 // Determine if a method should be compiled with a normal entry point at a different level. |
325 CompLevel SimpleThresholdPolicy::call_event(methodOop method, CompLevel cur_level) { |
325 CompLevel SimpleThresholdPolicy::call_event(methodOop method, CompLevel cur_level) { |
326 CompLevel osr_level = (CompLevel) method->highest_osr_comp_level(); |
326 CompLevel osr_level = MIN2((CompLevel) method->highest_osr_comp_level(), |
|
327 common(&SimpleThresholdPolicy::loop_predicate, method, cur_level)); |
327 CompLevel next_level = common(&SimpleThresholdPolicy::call_predicate, method, cur_level); |
328 CompLevel next_level = common(&SimpleThresholdPolicy::call_predicate, method, cur_level); |
328 |
329 |
329 // If OSR method level is greater than the regular method level, the levels should be |
330 // If OSR method level is greater than the regular method level, the levels should be |
330 // equalized by raising the regular method level in order to avoid OSRs during each |
331 // equalized by raising the regular method level in order to avoid OSRs during each |
331 // invocation of the method. |
332 // invocation of the method. |
342 return next_level; |
343 return next_level; |
343 } |
344 } |
344 |
345 |
345 // Determine if we should do an OSR compilation of a given method. |
346 // Determine if we should do an OSR compilation of a given method. |
346 CompLevel SimpleThresholdPolicy::loop_event(methodOop method, CompLevel cur_level) { |
347 CompLevel SimpleThresholdPolicy::loop_event(methodOop method, CompLevel cur_level) { |
|
348 CompLevel next_level = common(&SimpleThresholdPolicy::loop_predicate, method, cur_level); |
347 if (cur_level == CompLevel_none) { |
349 if (cur_level == CompLevel_none) { |
348 // If there is a live OSR method that means that we deopted to the interpreter |
350 // If there is a live OSR method that means that we deopted to the interpreter |
349 // for the transition. |
351 // for the transition. |
350 CompLevel osr_level = (CompLevel)method->highest_osr_comp_level(); |
352 CompLevel osr_level = MIN2((CompLevel)method->highest_osr_comp_level(), next_level); |
351 if (osr_level > CompLevel_none) { |
353 if (osr_level > CompLevel_none) { |
352 return osr_level; |
354 return osr_level; |
353 } |
355 } |
354 } |
356 } |
355 return common(&SimpleThresholdPolicy::loop_predicate, method, cur_level); |
357 return next_level; |
356 } |
358 } |
357 |
359 |
358 |
360 |
359 // Handle the invocation event. |
361 // Handle the invocation event. |
360 void SimpleThresholdPolicy::method_invocation_event(methodHandle mh, methodHandle imh, |
362 void SimpleThresholdPolicy::method_invocation_event(methodHandle mh, methodHandle imh, |