3849 assert(!_print_inlining || _print_inlining_stream->size() == 0, "loosing data"); |
3849 assert(!_print_inlining || _print_inlining_stream->size() == 0, "loosing data"); |
3850 } |
3850 } |
3851 |
3851 |
3852 void Compile::dump_inlining() { |
3852 void Compile::dump_inlining() { |
3853 bool do_print_inlining = print_inlining() || print_intrinsics(); |
3853 bool do_print_inlining = print_inlining() || print_intrinsics(); |
3854 if (do_print_inlining) { |
3854 if (do_print_inlining || log() != NULL) { |
3855 // Print inlining message for candidates that we couldn't inline |
3855 // Print inlining message for candidates that we couldn't inline |
3856 // for lack of space |
3856 // for lack of space |
3857 for (int i = 0; i < _late_inlines.length(); i++) { |
3857 for (int i = 0; i < _late_inlines.length(); i++) { |
3858 CallGenerator* cg = _late_inlines.at(i); |
3858 CallGenerator* cg = _late_inlines.at(i); |
3859 if (!cg->is_mh_late_inline()) { |
3859 if (!cg->is_mh_late_inline()) { |
3860 const char* msg = "live nodes > LiveNodeCountInliningCutoff"; |
3860 const char* msg = "live nodes > LiveNodeCountInliningCutoff"; |
3861 if (do_print_inlining) { |
3861 if (do_print_inlining) { |
3862 cg->print_inlining_late(msg); |
3862 cg->print_inlining_late(msg); |
3863 } |
3863 } |
|
3864 log_late_inline_failure(cg, msg); |
3864 } |
3865 } |
3865 } |
3866 } |
3866 } |
3867 } |
3867 if (do_print_inlining) { |
3868 if (do_print_inlining) { |
3868 for (int i = 0; i < _print_inlining_list->length(); i++) { |
3869 for (int i = 0; i < _print_inlining_list->length(); i++) { |
3869 tty->print(_print_inlining_list->adr_at(i)->ss()->as_string()); |
3870 tty->print(_print_inlining_list->adr_at(i)->ss()->as_string()); |
3870 } |
3871 } |
3871 } |
3872 } |
3872 } |
3873 } |
|
3874 |
|
3875 void Compile::log_late_inline(CallGenerator* cg) { |
|
3876 if (log() != NULL) { |
|
3877 log()->head("late_inline method='%d' inline_id='" JLONG_FORMAT "'", log()->identify(cg->method()), |
|
3878 cg->unique_id()); |
|
3879 JVMState* p = cg->call_node()->jvms(); |
|
3880 while (p != NULL) { |
|
3881 log()->elem("jvms bci='%d' method='%d'", p->bci(), log()->identify(p->method())); |
|
3882 p = p->caller(); |
|
3883 } |
|
3884 log()->tail("late_inline"); |
|
3885 } |
|
3886 } |
|
3887 |
|
3888 void Compile::log_late_inline_failure(CallGenerator* cg, const char* msg) { |
|
3889 log_late_inline(cg); |
|
3890 if (log() != NULL) { |
|
3891 log()->inline_fail(msg); |
|
3892 } |
|
3893 } |
|
3894 |
|
3895 void Compile::log_inline_id(CallGenerator* cg) { |
|
3896 if (log() != NULL) { |
|
3897 // The LogCompilation tool needs a unique way to identify late |
|
3898 // inline call sites. This id must be unique for this call site in |
|
3899 // this compilation. Try to have it unique across compilations as |
|
3900 // well because it can be convenient when grepping through the log |
|
3901 // file. |
|
3902 // Distinguish OSR compilations from others in case CICountOSR is |
|
3903 // on. |
|
3904 jlong id = ((jlong)unique()) + (((jlong)compile_id()) << 33) + (CICountOSR && is_osr_compilation() ? ((jlong)1) << 32 : 0); |
|
3905 cg->set_unique_id(id); |
|
3906 log()->elem("inline_id id='" JLONG_FORMAT "'", id); |
|
3907 } |
|
3908 } |
|
3909 |
|
3910 void Compile::log_inline_failure(const char* msg) { |
|
3911 if (C->log() != NULL) { |
|
3912 C->log()->inline_fail(msg); |
|
3913 } |
|
3914 } |
|
3915 |
3873 |
3916 |
3874 // Dump inlining replay data to the stream. |
3917 // Dump inlining replay data to the stream. |
3875 // Don't change thread state and acquire any locks. |
3918 // Don't change thread state and acquire any locks. |
3876 void Compile::dump_inline_data(outputStream* out) { |
3919 void Compile::dump_inline_data(outputStream* out) { |
3877 InlineTree* inl_tree = ilt(); |
3920 InlineTree* inl_tree = ilt(); |