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"); |