234 if (!can_be_compiled(mh, level)) {
235 if (level == CompLevel_full_optimization && can_be_compiled(mh, CompLevel_simple)) {
236 compile(mh, bci, CompLevel_simple, thread);
237 }
238 return;
239 }
240 if (bci != InvocationEntryBci && mh->is_not_osr_compilable(level)) {
241 return;
242 }
243 if (!CompileBroker::compilation_is_in_queue(mh)) {
244 if (PrintTieredEvents) {
245 print_event(COMPILE, mh, mh, bci, level);
246 }
247 submit_compile(mh, bci, level, thread);
248 }
249 }
250
251 // Tell the broker to compile the method
252 void SimpleThresholdPolicy::submit_compile(const methodHandle& mh, int bci, CompLevel level, JavaThread* thread) {
253 int hot_count = (bci == InvocationEntryBci) ? mh->invocation_count() : mh->backedge_count();
254 CompileBroker::compile_method(mh, bci, level, mh, hot_count, "tiered", thread);
255 }
256
257 // Call and loop predicates determine whether a transition to a higher
258 // compilation level should be performed (pointers to predicate functions
259 // are passed to common() transition function).
260 bool SimpleThresholdPolicy::loop_predicate(int i, int b, CompLevel cur_level, Method* method) {
261 switch(cur_level) {
262 case CompLevel_none:
263 case CompLevel_limited_profile: {
264 return loop_predicate_helper<CompLevel_none>(i, b, 1.0, method);
265 }
266 case CompLevel_full_profile: {
267 return loop_predicate_helper<CompLevel_full_profile>(i, b, 1.0, method);
268 }
269 default:
270 return true;
271 }
272 }
273
274 bool SimpleThresholdPolicy::call_predicate(int i, int b, CompLevel cur_level, Method* method) {
|
234 if (!can_be_compiled(mh, level)) {
235 if (level == CompLevel_full_optimization && can_be_compiled(mh, CompLevel_simple)) {
236 compile(mh, bci, CompLevel_simple, thread);
237 }
238 return;
239 }
240 if (bci != InvocationEntryBci && mh->is_not_osr_compilable(level)) {
241 return;
242 }
243 if (!CompileBroker::compilation_is_in_queue(mh)) {
244 if (PrintTieredEvents) {
245 print_event(COMPILE, mh, mh, bci, level);
246 }
247 submit_compile(mh, bci, level, thread);
248 }
249 }
250
251 // Tell the broker to compile the method
252 void SimpleThresholdPolicy::submit_compile(const methodHandle& mh, int bci, CompLevel level, JavaThread* thread) {
253 int hot_count = (bci == InvocationEntryBci) ? mh->invocation_count() : mh->backedge_count();
254 CompileBroker::compile_method(mh, bci, level, mh, hot_count, "tiered", false, thread);
255 }
256
257 // Call and loop predicates determine whether a transition to a higher
258 // compilation level should be performed (pointers to predicate functions
259 // are passed to common() transition function).
260 bool SimpleThresholdPolicy::loop_predicate(int i, int b, CompLevel cur_level, Method* method) {
261 switch(cur_level) {
262 case CompLevel_none:
263 case CompLevel_limited_profile: {
264 return loop_predicate_helper<CompLevel_none>(i, b, 1.0, method);
265 }
266 case CompLevel_full_profile: {
267 return loop_predicate_helper<CompLevel_full_profile>(i, b, 1.0, method);
268 }
269 default:
270 return true;
271 }
272 }
273
274 bool SimpleThresholdPolicy::call_predicate(int i, int b, CompLevel cur_level, Method* method) {
|