hotspot/src/share/vm/runtime/simpleThresholdPolicy.cpp
changeset 27447 5cd7caca045d
parent 24324 e18584aa83e2
child 28650 772aaab2582f
equal deleted inserted replaced
27428:c5ace5b96ae2 27447:5cd7caca045d
   194   }
   194   }
   195   if (CompileTheWorld || ReplayCompiles) {
   195   if (CompileTheWorld || ReplayCompiles) {
   196     // Don't trigger other compiles in testing mode
   196     // Don't trigger other compiles in testing mode
   197     return NULL;
   197     return NULL;
   198   }
   198   }
   199   nmethod *osr_nm = NULL;
       
   200 
   199 
   201   handle_counter_overflow(method());
   200   handle_counter_overflow(method());
   202   if (method() != inlinee()) {
   201   if (method() != inlinee()) {
   203     handle_counter_overflow(inlinee());
   202     handle_counter_overflow(inlinee());
   204   }
   203   }
   208   }
   207   }
   209 
   208 
   210   if (bci == InvocationEntryBci) {
   209   if (bci == InvocationEntryBci) {
   211     method_invocation_event(method, inlinee, comp_level, nm, thread);
   210     method_invocation_event(method, inlinee, comp_level, nm, thread);
   212   } else {
   211   } else {
       
   212     // method == inlinee if the event originated in the main method
   213     method_back_branch_event(method, inlinee, bci, comp_level, nm, thread);
   213     method_back_branch_event(method, inlinee, bci, comp_level, nm, thread);
   214     // method == inlinee if the event originated in the main method
   214     // Check if event led to a higher level OSR compilation
   215     int highest_level = inlinee->highest_osr_comp_level();
   215     nmethod* osr_nm = inlinee->lookup_osr_nmethod_for(bci, comp_level, false);
   216     if (highest_level > comp_level) {
   216     if (osr_nm != NULL && osr_nm->comp_level() > comp_level) {
   217       osr_nm = inlinee->lookup_osr_nmethod_for(bci, highest_level, false);
   217       // Perform OSR with new nmethod
   218     }
   218       return osr_nm;
   219   }
   219     }
   220   return osr_nm;
   220   }
       
   221   return NULL;
   221 }
   222 }
   222 
   223 
   223 // Check if the method can be compiled, change level if necessary
   224 // Check if the method can be compiled, change level if necessary
   224 void SimpleThresholdPolicy::compile(methodHandle mh, int bci, CompLevel level, JavaThread* thread) {
   225 void SimpleThresholdPolicy::compile(methodHandle mh, int bci, CompLevel level, JavaThread* thread) {
   225   assert(level <= TieredStopAtLevel, "Invalid compilation level");
   226   assert(level <= TieredStopAtLevel, "Invalid compilation level");