< prev index next >

src/hotspot/share/opto/bytecodeInfo.cpp

Print this page

194 // negative filter: should callee NOT be inlined?
195 bool InlineTree::should_not_inline(ciMethod *callee_method,
196                                    ciMethod* caller_method,
197                                    JVMState* jvms) {
198 
199   const char* fail_msg = NULL;
200 
201   // First check all inlining restrictions which are required for correctness
202   if (callee_method->is_abstract()) {
203     fail_msg = "abstract method"; // // note: we allow ik->is_abstract()
204   } else if (!callee_method->holder()->is_initialized() &&
205              // access allowed in the context of static initializer
206              C->needs_clinit_barrier(callee_method->holder(), caller_method)) {
207     fail_msg = "method holder not initialized";
208   } else if (callee_method->is_native()) {
209     fail_msg = "native method";
210   } else if (callee_method->dont_inline()) {
211     fail_msg = "don't inline by annotation";
212   }
213 







214   // one more inlining restriction
215   if (fail_msg == NULL && callee_method->has_unloaded_classes_in_signature()) {
216     fail_msg = "unloaded signature classes";
217   }
218 
219   if (fail_msg != NULL) {
220     set_msg(fail_msg);
221     return true;
222   }
223 
224   // ignore heuristic controls on inlining
225   if (C->directive()->should_inline(callee_method)) {
226     set_msg("force inline by CompileCommand");
227     return false;
228   }
229 
230   if (C->directive()->should_not_inline(callee_method)) {
231     set_msg("disallowed by CompileCommand");
232     return true;
233   }

194 // negative filter: should callee NOT be inlined?
195 bool InlineTree::should_not_inline(ciMethod *callee_method,
196                                    ciMethod* caller_method,
197                                    JVMState* jvms) {
198 
199   const char* fail_msg = NULL;
200 
201   // First check all inlining restrictions which are required for correctness
202   if (callee_method->is_abstract()) {
203     fail_msg = "abstract method"; // // note: we allow ik->is_abstract()
204   } else if (!callee_method->holder()->is_initialized() &&
205              // access allowed in the context of static initializer
206              C->needs_clinit_barrier(callee_method->holder(), caller_method)) {
207     fail_msg = "method holder not initialized";
208   } else if (callee_method->is_native()) {
209     fail_msg = "native method";
210   } else if (callee_method->dont_inline()) {
211     fail_msg = "don't inline by annotation";
212   }
213 
214   // Don't inline a method that changes Thread.currentThread() except
215   // into another method that is annotated @ChangesCurrentThread.
216   if (callee_method->changes_current_thread()
217       && ! C->method()->changes_current_thread()) {
218     fail_msg = "method changes current thread";
219   }
220 
221   // one more inlining restriction
222   if (fail_msg == NULL && callee_method->has_unloaded_classes_in_signature()) {
223     fail_msg = "unloaded signature classes";
224   }
225 
226   if (fail_msg != NULL) {
227     set_msg(fail_msg);
228     return true;
229   }
230 
231   // ignore heuristic controls on inlining
232   if (C->directive()->should_inline(callee_method)) {
233     set_msg("force inline by CompileCommand");
234     return false;
235   }
236 
237   if (C->directive()->should_not_inline(callee_method)) {
238     set_msg("disallowed by CompileCommand");
239     return true;
240   }
< prev index next >