hotspot/src/share/vm/opto/doCall.cpp
changeset 17383 3665c0901a0d
parent 15210 eb42543a7050
child 20073 bfc95277d42b
equal deleted inserted replaced
17382:bba473b81ec0 17383:3665c0901a0d
   174 
   174 
   175         if (require_inline && cg != NULL) {
   175         if (require_inline && cg != NULL) {
   176           // Delay the inlining of this method to give us the
   176           // Delay the inlining of this method to give us the
   177           // opportunity to perform some high level optimizations
   177           // opportunity to perform some high level optimizations
   178           // first.
   178           // first.
   179           if (should_delay_inlining(callee, jvms)) {
   179           if (should_delay_string_inlining(callee, jvms)) {
   180             assert(!delayed_forbidden, "strange");
   180             assert(!delayed_forbidden, "strange");
   181             return CallGenerator::for_string_late_inline(callee, cg);
   181             return CallGenerator::for_string_late_inline(callee, cg);
       
   182           } else if (should_delay_boxing_inlining(callee, jvms)) {
       
   183             assert(!delayed_forbidden, "strange");
       
   184             return CallGenerator::for_boxing_late_inline(callee, cg);
   182           } else if ((should_delay || AlwaysIncrementalInline) && !delayed_forbidden) {
   185           } else if ((should_delay || AlwaysIncrementalInline) && !delayed_forbidden) {
   183             return CallGenerator::for_late_inline(callee, cg);
   186             return CallGenerator::for_late_inline(callee, cg);
   184           }
   187           }
   185         }
   188         }
   186         if (cg == NULL || should_delay) {
   189         if (cg == NULL || should_delay) {
   274   }
   277   }
   275 }
   278 }
   276 
   279 
   277 // Return true for methods that shouldn't be inlined early so that
   280 // Return true for methods that shouldn't be inlined early so that
   278 // they are easier to analyze and optimize as intrinsics.
   281 // they are easier to analyze and optimize as intrinsics.
   279 bool Compile::should_delay_inlining(ciMethod* call_method, JVMState* jvms) {
   282 bool Compile::should_delay_string_inlining(ciMethod* call_method, JVMState* jvms) {
   280   if (has_stringbuilder()) {
   283   if (has_stringbuilder()) {
   281 
   284 
   282     if ((call_method->holder() == C->env()->StringBuilder_klass() ||
   285     if ((call_method->holder() == C->env()->StringBuilder_klass() ||
   283          call_method->holder() == C->env()->StringBuffer_klass()) &&
   286          call_method->holder() == C->env()->StringBuffer_klass()) &&
   284         (jvms->method()->holder() == C->env()->StringBuilder_klass() ||
   287         (jvms->method()->holder() == C->env()->StringBuilder_klass() ||
   325     }
   328     }
   326   }
   329   }
   327   return false;
   330   return false;
   328 }
   331 }
   329 
   332 
       
   333 bool Compile::should_delay_boxing_inlining(ciMethod* call_method, JVMState* jvms) {
       
   334   if (eliminate_boxing() && call_method->is_boxing_method()) {
       
   335     set_has_boxed_value(true);
       
   336     return true;
       
   337   }
       
   338   return false;
       
   339 }
   330 
   340 
   331 // uncommon-trap call-sites where callee is unloaded, uninitialized or will not link
   341 // uncommon-trap call-sites where callee is unloaded, uninitialized or will not link
   332 bool Parse::can_not_compile_call_site(ciMethod *dest_method, ciInstanceKlass* klass) {
   342 bool Parse::can_not_compile_call_site(ciMethod *dest_method, ciInstanceKlass* klass) {
   333   // Additional inputs to consider...
   343   // Additional inputs to consider...
   334   // bc      = bc()
   344   // bc      = bc()