hotspot/src/share/vm/opto/bytecodeInfo.cpp
changeset 12160 c3ce1d6b88e1
parent 10547 ea4a2ec31ae2
child 13391 30245956af37
equal deleted inserted replaced
12159:714449dc1f6d 12160:c3ce1d6b88e1
   255     ciInstanceKlass* k = top->method()->holder();
   255     ciInstanceKlass* k = top->method()->holder();
   256     if (!k->is_subclass_of(C->env()->Throwable_klass()))
   256     if (!k->is_subclass_of(C->env()->Throwable_klass()))
   257       return "exception method";
   257       return "exception method";
   258   }
   258   }
   259 
   259 
   260   // use frequency-based objections only for non-trivial methods
       
   261   if (callee_method->code_size_for_inlining() <= MaxTrivialSize) return NULL;
       
   262 
       
   263   // don't use counts with -Xcomp or CTW
       
   264   if (UseInterpreter && !CompileTheWorld) {
       
   265 
       
   266     if (!callee_method->has_compiled_code() &&
       
   267         !callee_method->was_executed_more_than(0)) {
       
   268       return "never executed";
       
   269     }
       
   270 
       
   271     if (is_init_with_ea(callee_method, caller_method, C)) {
       
   272 
       
   273       // Escape Analysis: inline all executed constructors
       
   274 
       
   275     } else if (!callee_method->was_executed_more_than(MIN2(MinInliningThreshold,
       
   276                                                            CompileThreshold >> 1))) {
       
   277       return "executed < MinInliningThreshold times";
       
   278     }
       
   279   }
       
   280 
       
   281   if (callee_method->should_not_inline()) {
   260   if (callee_method->should_not_inline()) {
   282     return "disallowed by CompilerOracle";
   261     return "disallowed by CompilerOracle";
   283   }
   262   }
   284 
   263 
   285   if (UseStringCache) {
   264   if (UseStringCache) {
   286     // Do not inline StringCache::profile() method used only at the beginning.
   265     // Do not inline StringCache::profile() method used only at the beginning.
   287     if (callee_method->name() == ciSymbol::profile_name() &&
   266     if (callee_method->name() == ciSymbol::profile_name() &&
   288         callee_method->holder()->name() == ciSymbol::java_lang_StringCache()) {
   267         callee_method->holder()->name() == ciSymbol::java_lang_StringCache()) {
   289       return "profiling method";
   268       return "profiling method";
       
   269     }
       
   270   }
       
   271 
       
   272   // use frequency-based objections only for non-trivial methods
       
   273   if (callee_method->code_size_for_inlining() <= MaxTrivialSize) return NULL;
       
   274 
       
   275   // don't use counts with -Xcomp or CTW
       
   276   if (UseInterpreter && !CompileTheWorld) {
       
   277 
       
   278     if (!callee_method->has_compiled_code() &&
       
   279         !callee_method->was_executed_more_than(0)) {
       
   280       return "never executed";
       
   281     }
       
   282 
       
   283     if (is_init_with_ea(callee_method, caller_method, C)) {
       
   284 
       
   285       // Escape Analysis: inline all executed constructors
       
   286 
       
   287     } else if (!callee_method->was_executed_more_than(MIN2(MinInliningThreshold,
       
   288                                                            CompileThreshold >> 1))) {
       
   289       return "executed < MinInliningThreshold times";
   290     }
   290     }
   291   }
   291   }
   292 
   292 
   293   return NULL;
   293   return NULL;
   294 }
   294 }