248 if (!can_be_compiled(mh, level)) {
249 if (level == CompLevel_full_optimization && can_be_compiled(mh, CompLevel_simple)) {
250 compile(mh, bci, CompLevel_simple, thread);
251 }
252 return;
253 }
254 if (bci != InvocationEntryBci && mh->is_not_osr_compilable(level)) {
255 return;
256 }
257 if (!CompileBroker::compilation_is_in_queue(mh)) {
258 if (PrintTieredEvents) {
259 print_event(COMPILE, mh, mh, bci, level);
260 }
261 submit_compile(mh, bci, level, thread);
262 }
263 }
264
265 // Tell the broker to compile the method
266 void SimpleThresholdPolicy::submit_compile(const methodHandle& mh, int bci, CompLevel level, JavaThread* thread) {
267 int hot_count = (bci == InvocationEntryBci) ? mh->invocation_count() : mh->backedge_count();
268 CompileBroker::compile_method(mh, bci, level, mh, hot_count, "tiered", thread);
269 }
270
271 // Call and loop predicates determine whether a transition to a higher
272 // compilation level should be performed (pointers to predicate functions
273 // are passed to common() transition function).
274 bool SimpleThresholdPolicy::loop_predicate(int i, int b, CompLevel cur_level, Method* method) {
275 switch(cur_level) {
276 case CompLevel_none:
277 case CompLevel_limited_profile: {
278 return loop_predicate_helper<CompLevel_none>(i, b, 1.0, method);
279 }
280 case CompLevel_full_profile: {
281 return loop_predicate_helper<CompLevel_full_profile>(i, b, 1.0, method);
282 }
283 default:
284 return true;
285 }
286 }
287
288 bool SimpleThresholdPolicy::call_predicate(int i, int b, CompLevel cur_level, Method* method) {
|
248 if (!can_be_compiled(mh, level)) {
249 if (level == CompLevel_full_optimization && can_be_compiled(mh, CompLevel_simple)) {
250 compile(mh, bci, CompLevel_simple, thread);
251 }
252 return;
253 }
254 if (bci != InvocationEntryBci && mh->is_not_osr_compilable(level)) {
255 return;
256 }
257 if (!CompileBroker::compilation_is_in_queue(mh)) {
258 if (PrintTieredEvents) {
259 print_event(COMPILE, mh, mh, bci, level);
260 }
261 submit_compile(mh, bci, level, thread);
262 }
263 }
264
265 // Tell the broker to compile the method
266 void SimpleThresholdPolicy::submit_compile(const methodHandle& mh, int bci, CompLevel level, JavaThread* thread) {
267 int hot_count = (bci == InvocationEntryBci) ? mh->invocation_count() : mh->backedge_count();
268 CompileBroker::compile_method(mh, bci, level, mh, hot_count, CompileTask::Reason_Tiered, thread);
269 }
270
271 // Call and loop predicates determine whether a transition to a higher
272 // compilation level should be performed (pointers to predicate functions
273 // are passed to common() transition function).
274 bool SimpleThresholdPolicy::loop_predicate(int i, int b, CompLevel cur_level, Method* method) {
275 switch(cur_level) {
276 case CompLevel_none:
277 case CompLevel_limited_profile: {
278 return loop_predicate_helper<CompLevel_none>(i, b, 1.0, method);
279 }
280 case CompLevel_full_profile: {
281 return loop_predicate_helper<CompLevel_full_profile>(i, b, 1.0, method);
282 }
283 default:
284 return true;
285 }
286 }
287
288 bool SimpleThresholdPolicy::call_predicate(int i, int b, CompLevel cur_level, Method* method) {
|