hotspot/src/share/vm/runtime/simpleThresholdPolicy.cpp
changeset 24321 621f7e09fc0a
parent 24013 1d16b0f1060d
child 24324 e18584aa83e2
equal deleted inserted replaced
24320:394d55c783dc 24321:621f7e09fc0a
   233     return;
   233     return;
   234   }
   234   }
   235   if (bci != InvocationEntryBci && mh->is_not_osr_compilable(level)) {
   235   if (bci != InvocationEntryBci && mh->is_not_osr_compilable(level)) {
   236     return;
   236     return;
   237   }
   237   }
   238   if (!CompileBroker::compilation_is_in_queue(mh, bci)) {
   238   if (!CompileBroker::compilation_is_in_queue(mh)) {
   239     if (PrintTieredEvents) {
   239     if (PrintTieredEvents) {
   240       print_event(COMPILE, mh, mh, bci, level);
   240       print_event(COMPILE, mh, mh, bci, level);
   241     }
   241     }
   242     submit_compile(mh, bci, level, thread);
   242     submit_compile(mh, bci, level, thread);
   243   }
   243   }
   372 
   372 
   373 
   373 
   374 // Handle the invocation event.
   374 // Handle the invocation event.
   375 void SimpleThresholdPolicy::method_invocation_event(methodHandle mh, methodHandle imh,
   375 void SimpleThresholdPolicy::method_invocation_event(methodHandle mh, methodHandle imh,
   376                                               CompLevel level, nmethod* nm, JavaThread* thread) {
   376                                               CompLevel level, nmethod* nm, JavaThread* thread) {
   377   if (is_compilation_enabled() && !CompileBroker::compilation_is_in_queue(mh, InvocationEntryBci)) {
   377   if (is_compilation_enabled() && !CompileBroker::compilation_is_in_queue(mh)) {
   378     CompLevel next_level = call_event(mh(), level);
   378     CompLevel next_level = call_event(mh(), level);
   379     if (next_level != level) {
   379     if (next_level != level) {
   380       compile(mh, InvocationEntryBci, next_level, thread);
   380       compile(mh, InvocationEntryBci, next_level, thread);
   381     }
   381     }
   382   }
   382   }
   385 // Handle the back branch event. Notice that we can compile the method
   385 // Handle the back branch event. Notice that we can compile the method
   386 // with a regular entry from here.
   386 // with a regular entry from here.
   387 void SimpleThresholdPolicy::method_back_branch_event(methodHandle mh, methodHandle imh,
   387 void SimpleThresholdPolicy::method_back_branch_event(methodHandle mh, methodHandle imh,
   388                                                      int bci, CompLevel level, nmethod* nm, JavaThread* thread) {
   388                                                      int bci, CompLevel level, nmethod* nm, JavaThread* thread) {
   389   // If the method is already compiling, quickly bail out.
   389   // If the method is already compiling, quickly bail out.
   390   if (is_compilation_enabled() && !CompileBroker::compilation_is_in_queue(mh, bci)) {
   390   if (is_compilation_enabled() && !CompileBroker::compilation_is_in_queue(mh)) {
   391     // Use loop event as an opportunity to also check there's been
   391     // Use loop event as an opportunity to also check there's been
   392     // enough calls.
   392     // enough calls.
   393     CompLevel cur_level = comp_level(mh());
   393     CompLevel cur_level = comp_level(mh());
   394     CompLevel next_level = call_event(mh(), cur_level);
   394     CompLevel next_level = call_event(mh(), cur_level);
   395     CompLevel next_osr_level = loop_event(mh(), level);
   395     CompLevel next_osr_level = loop_event(mh(), level);