hotspot/src/share/vm/opto/library_call.cpp
changeset 46327 91576389a517
parent 43963 6845bb645be5
parent 46289 1904e7ec236e
child 46369 3bf4544bec14
equal deleted inserted replaced
44203:d2d435372329 46327:91576389a517
   386   const int bci    = kit.bci();
   386   const int bci    = kit.bci();
   387 
   387 
   388   // Try to inline the intrinsic.
   388   // Try to inline the intrinsic.
   389   if ((CheckIntrinsics ? callee->intrinsic_candidate() : true) &&
   389   if ((CheckIntrinsics ? callee->intrinsic_candidate() : true) &&
   390       kit.try_to_inline(_last_predicate)) {
   390       kit.try_to_inline(_last_predicate)) {
       
   391     const char *inline_msg = is_virtual() ? "(intrinsic, virtual)"
       
   392                                           : "(intrinsic)";
       
   393     CompileTask::print_inlining_ul(callee, jvms->depth() - 1, bci, inline_msg);
   391     if (C->print_intrinsics() || C->print_inlining()) {
   394     if (C->print_intrinsics() || C->print_inlining()) {
   392       C->print_inlining(callee, jvms->depth() - 1, bci, is_virtual() ? "(intrinsic, virtual)" : "(intrinsic)");
   395       C->print_inlining(callee, jvms->depth() - 1, bci, inline_msg);
   393     }
   396     }
   394     C->gather_intrinsic_statistics(intrinsic_id(), is_virtual(), Compile::_intrinsic_worked);
   397     C->gather_intrinsic_statistics(intrinsic_id(), is_virtual(), Compile::_intrinsic_worked);
   395     if (C->log()) {
   398     if (C->log()) {
   396       C->log()->elem("intrinsic id='%s'%s nodes='%d'",
   399       C->log()->elem("intrinsic id='%s'%s nodes='%d'",
   397                      vmIntrinsics::name_at(intrinsic_id()),
   400                      vmIntrinsics::name_at(intrinsic_id()),
   403     C->print_inlining_update(this);
   406     C->print_inlining_update(this);
   404     return kit.transfer_exceptions_into_jvms();
   407     return kit.transfer_exceptions_into_jvms();
   405   }
   408   }
   406 
   409 
   407   // The intrinsic bailed out
   410   // The intrinsic bailed out
   408   if (C->print_intrinsics() || C->print_inlining()) {
   411   if (jvms->has_method()) {
   409     if (jvms->has_method()) {
   412     // Not a root compile.
   410       // Not a root compile.
   413     const char* msg;
   411       const char* msg;
   414     if (callee->intrinsic_candidate()) {
   412       if (callee->intrinsic_candidate()) {
   415       msg = is_virtual() ? "failed to inline (intrinsic, virtual)" : "failed to inline (intrinsic)";
   413         msg = is_virtual() ? "failed to inline (intrinsic, virtual)" : "failed to inline (intrinsic)";
   416     } else {
   414       } else {
   417       msg = is_virtual() ? "failed to inline (intrinsic, virtual), method not annotated"
   415         msg = is_virtual() ? "failed to inline (intrinsic, virtual), method not annotated"
   418                          : "failed to inline (intrinsic), method not annotated";
   416                            : "failed to inline (intrinsic), method not annotated";
   419     }
   417       }
   420     CompileTask::print_inlining_ul(callee, jvms->depth() - 1, bci, msg);
       
   421     if (C->print_intrinsics() || C->print_inlining()) {
   418       C->print_inlining(callee, jvms->depth() - 1, bci, msg);
   422       C->print_inlining(callee, jvms->depth() - 1, bci, msg);
   419     } else {
   423     }
   420       // Root compile
   424   } else {
   421       tty->print("Did not generate intrinsic %s%s at bci:%d in",
   425     // Root compile
   422                vmIntrinsics::name_at(intrinsic_id()),
   426     ResourceMark rm;
   423                (is_virtual() ? " (virtual)" : ""), bci);
   427     stringStream msg_stream;
       
   428     msg_stream.print("Did not generate intrinsic %s%s at bci:%d in",
       
   429                      vmIntrinsics::name_at(intrinsic_id()),
       
   430                      is_virtual() ? " (virtual)" : "", bci);
       
   431     const char *msg = msg_stream.as_string();
       
   432     log_debug(jit, inlining)("%s", msg);
       
   433     if (C->print_intrinsics() || C->print_inlining()) {
       
   434       tty->print("%s", msg);
   424     }
   435     }
   425   }
   436   }
   426   C->gather_intrinsic_statistics(intrinsic_id(), is_virtual(), Compile::_intrinsic_failed);
   437   C->gather_intrinsic_statistics(intrinsic_id(), is_virtual(), Compile::_intrinsic_failed);
   427   C->print_inlining_update(this);
   438   C->print_inlining_update(this);
   428   return NULL;
   439   return NULL;
   444   ciMethod* callee = kit.callee();
   455   ciMethod* callee = kit.callee();
   445   const int bci    = kit.bci();
   456   const int bci    = kit.bci();
   446 
   457 
   447   Node* slow_ctl = kit.try_to_predicate(predicate);
   458   Node* slow_ctl = kit.try_to_predicate(predicate);
   448   if (!kit.failing()) {
   459   if (!kit.failing()) {
       
   460     const char *inline_msg = is_virtual() ? "(intrinsic, virtual, predicate)"
       
   461                                           : "(intrinsic, predicate)";
       
   462     CompileTask::print_inlining_ul(callee, jvms->depth() - 1, bci, inline_msg);
   449     if (C->print_intrinsics() || C->print_inlining()) {
   463     if (C->print_intrinsics() || C->print_inlining()) {
   450       C->print_inlining(callee, jvms->depth() - 1, bci, is_virtual() ? "(intrinsic, virtual, predicate)" : "(intrinsic, predicate)");
   464       C->print_inlining(callee, jvms->depth() - 1, bci, inline_msg);
   451     }
   465     }
   452     C->gather_intrinsic_statistics(intrinsic_id(), is_virtual(), Compile::_intrinsic_worked);
   466     C->gather_intrinsic_statistics(intrinsic_id(), is_virtual(), Compile::_intrinsic_worked);
   453     if (C->log()) {
   467     if (C->log()) {
   454       C->log()->elem("predicate_intrinsic id='%s'%s nodes='%d'",
   468       C->log()->elem("predicate_intrinsic id='%s'%s nodes='%d'",
   455                      vmIntrinsics::name_at(intrinsic_id()),
   469                      vmIntrinsics::name_at(intrinsic_id()),
   458     }
   472     }
   459     return slow_ctl; // Could be NULL if the check folds.
   473     return slow_ctl; // Could be NULL if the check folds.
   460   }
   474   }
   461 
   475 
   462   // The intrinsic bailed out
   476   // The intrinsic bailed out
   463   if (C->print_intrinsics() || C->print_inlining()) {
   477   if (jvms->has_method()) {
   464     if (jvms->has_method()) {
   478     // Not a root compile.
   465       // Not a root compile.
   479     const char* msg = "failed to generate predicate for intrinsic";
   466       const char* msg = "failed to generate predicate for intrinsic";
   480     CompileTask::print_inlining_ul(kit.callee(), jvms->depth() - 1, bci, msg);
       
   481     if (C->print_intrinsics() || C->print_inlining()) {
   467       C->print_inlining(kit.callee(), jvms->depth() - 1, bci, msg);
   482       C->print_inlining(kit.callee(), jvms->depth() - 1, bci, msg);
   468     } else {
   483     }
   469       // Root compile
   484   } else {
   470       C->print_inlining_stream()->print("Did not generate predicate for intrinsic %s%s at bci:%d in",
   485     // Root compile
   471                                         vmIntrinsics::name_at(intrinsic_id()),
   486     ResourceMark rm;
   472                                         (is_virtual() ? " (virtual)" : ""), bci);
   487     stringStream msg_stream;
       
   488     msg_stream.print("Did not generate intrinsic %s%s at bci:%d in",
       
   489                      vmIntrinsics::name_at(intrinsic_id()),
       
   490                      is_virtual() ? " (virtual)" : "", bci);
       
   491     const char *msg = msg_stream.as_string();
       
   492     log_debug(jit, inlining)("%s", msg);
       
   493     if (C->print_intrinsics() || C->print_inlining()) {
       
   494       C->print_inlining_stream()->print("%s", msg);
   473     }
   495     }
   474   }
   496   }
   475   C->gather_intrinsic_statistics(intrinsic_id(), is_virtual(), Compile::_intrinsic_failed);
   497   C->gather_intrinsic_statistics(intrinsic_id(), is_virtual(), Compile::_intrinsic_failed);
   476   return NULL;
   498   return NULL;
   477 }
   499 }