提交 a163ce9a 编写于 作者: V vlivanov

8005439: no message about inline method if it specifed by CompileCommand

Reviewed-by: kvn, vlivanov
Contributed-by: NIgor Ignatyev <igor.ignatyev@oracle.com>
上级 5c45d906
...@@ -3667,11 +3667,12 @@ bool GraphBuilder::try_inline_full(ciMethod* callee, bool holder_known, Bytecode ...@@ -3667,11 +3667,12 @@ bool GraphBuilder::try_inline_full(ciMethod* callee, bool holder_known, Bytecode
} }
// now perform tests that are based on flag settings // now perform tests that are based on flag settings
if (callee->force_inline() || callee->should_inline()) { if (callee->force_inline()) {
// ignore heuristic controls on inlining print_inlining(callee, "force inline by annotation");
if (callee->force_inline()) } else if (callee->should_inline()) {
print_inlining(callee, "force inline by annotation"); print_inlining(callee, "force inline by CompileOracle");
} else { } else {
// use heuristic controls on inlining
if (inline_level() > MaxInlineLevel ) INLINE_BAILOUT("inlining too deep"); if (inline_level() > MaxInlineLevel ) INLINE_BAILOUT("inlining too deep");
if (recursive_inline_level(callee) > MaxRecursiveInlineLevel) INLINE_BAILOUT("recursive inlining too deep"); if (recursive_inline_level(callee) > MaxRecursiveInlineLevel) INLINE_BAILOUT("recursive inlining too deep");
if (callee->code_size_for_inlining() > max_inline_size() ) INLINE_BAILOUT("callee is too large"); if (callee->code_size_for_inlining() > max_inline_size() ) INLINE_BAILOUT("callee is too large");
......
...@@ -420,14 +420,24 @@ const char* InlineTree::check_can_parse(ciMethod* callee) { ...@@ -420,14 +420,24 @@ const char* InlineTree::check_can_parse(ciMethod* callee) {
} }
//------------------------------print_inlining--------------------------------- //------------------------------print_inlining---------------------------------
// Really, the failure_msg can be a success message also. void InlineTree::print_inlining(ciMethod* callee_method, int caller_bci,
void InlineTree::print_inlining(ciMethod* callee_method, int caller_bci, const char* failure_msg) const { const char* msg, bool success) const {
C->print_inlining(callee_method, inline_level(), caller_bci, failure_msg ? failure_msg : "inline"); assert(msg != NULL, "just checking");
if (callee_method == NULL) tty->print(" callee not monotonic or profiled"); if (C->log() != NULL) {
if (Verbose && callee_method) { if (success) {
const InlineTree *top = this; C->log()->inline_success(msg);
while( top->caller_tree() != NULL ) { top = top->caller_tree(); } } else {
//tty->print(" bcs: %d+%d invoked: %d", top->count_inline_bcs(), callee_method->code_size(), callee_method->interpreter_invocation_count()); C->log()->inline_fail(msg);
}
}
if (PrintInlining) {
C->print_inlining(callee_method, inline_level(), caller_bci, msg);
if (callee_method == NULL) tty->print(" callee not monotonic or profiled");
if (Verbose && callee_method) {
const InlineTree *top = this;
while( top->caller_tree() != NULL ) { top = top->caller_tree(); }
//tty->print(" bcs: %d+%d invoked: %d", top->count_inline_bcs(), callee_method->code_size(), callee_method->interpreter_invocation_count());
}
} }
} }
...@@ -451,23 +461,23 @@ WarmCallInfo* InlineTree::ok_to_inline(ciMethod* callee_method, JVMState* jvms, ...@@ -451,23 +461,23 @@ WarmCallInfo* InlineTree::ok_to_inline(ciMethod* callee_method, JVMState* jvms,
// Do some initial checks. // Do some initial checks.
if (!pass_initial_checks(caller_method, caller_bci, callee_method)) { if (!pass_initial_checks(caller_method, caller_bci, callee_method)) {
if (PrintInlining) print_inlining(callee_method, caller_bci, "failed initial checks"); print_inlining(callee_method, caller_bci, "failed initial checks",
false /* !success */);
return NULL; return NULL;
} }
// Do some parse checks. // Do some parse checks.
failure_msg = check_can_parse(callee_method); failure_msg = check_can_parse(callee_method);
if (failure_msg != NULL) { if (failure_msg != NULL) {
if (PrintInlining) print_inlining(callee_method, caller_bci, failure_msg); print_inlining(callee_method, caller_bci, failure_msg,
false /* !success */);
return NULL; return NULL;
} }
// Check if inlining policy says no. // Check if inlining policy says no.
WarmCallInfo wci = *(initial_wci); WarmCallInfo wci = *(initial_wci);
failure_msg = try_to_inline(callee_method, caller_method, caller_bci, profile, &wci, should_delay); failure_msg = try_to_inline(callee_method, caller_method, caller_bci, profile,
if (failure_msg != NULL && C->log() != NULL) { &wci, should_delay);
C->log()->inline_fail(failure_msg);
}
#ifndef PRODUCT #ifndef PRODUCT
if (UseOldInlining && InlineWarmCalls if (UseOldInlining && InlineWarmCalls
...@@ -487,7 +497,7 @@ WarmCallInfo* InlineTree::ok_to_inline(ciMethod* callee_method, JVMState* jvms, ...@@ -487,7 +497,7 @@ WarmCallInfo* InlineTree::ok_to_inline(ciMethod* callee_method, JVMState* jvms,
wci = *(WarmCallInfo::always_hot()); wci = *(WarmCallInfo::always_hot());
else else
wci = *(WarmCallInfo::always_cold()); wci = *(WarmCallInfo::always_cold());
} }
if (!InlineWarmCalls) { if (!InlineWarmCalls) {
if (!wci.is_cold() && !wci.is_hot()) { if (!wci.is_cold() && !wci.is_hot()) {
// Do not inline the warm calls. // Do not inline the warm calls.
...@@ -496,11 +506,10 @@ WarmCallInfo* InlineTree::ok_to_inline(ciMethod* callee_method, JVMState* jvms, ...@@ -496,11 +506,10 @@ WarmCallInfo* InlineTree::ok_to_inline(ciMethod* callee_method, JVMState* jvms,
} }
if (!wci.is_cold()) { if (!wci.is_cold()) {
// In -UseOldInlining, the failure_msg may also be a success message.
if (failure_msg == NULL) failure_msg = "inline (hot)";
// Inline! // Inline!
if (PrintInlining) print_inlining(callee_method, caller_bci, failure_msg); print_inlining(callee_method, caller_bci,
failure_msg ? failure_msg : "inline (hot)",
true /* success */);
if (UseOldInlining) if (UseOldInlining)
build_inline_tree_for_callee(callee_method, jvms, caller_bci); build_inline_tree_for_callee(callee_method, jvms, caller_bci);
if (InlineWarmCalls && !wci.is_hot()) if (InlineWarmCalls && !wci.is_hot())
...@@ -509,8 +518,9 @@ WarmCallInfo* InlineTree::ok_to_inline(ciMethod* callee_method, JVMState* jvms, ...@@ -509,8 +518,9 @@ WarmCallInfo* InlineTree::ok_to_inline(ciMethod* callee_method, JVMState* jvms,
} }
// Do not inline // Do not inline
if (failure_msg == NULL) failure_msg = "too cold to inline"; print_inlining(callee_method, caller_bci,
if (PrintInlining) print_inlining(callee_method, caller_bci, failure_msg); failure_msg ? failure_msg : "too cold to inline",
false /* !success */ );
return NULL; return NULL;
} }
......
...@@ -73,7 +73,8 @@ protected: ...@@ -73,7 +73,8 @@ protected:
const char* try_to_inline(ciMethod* callee_method, ciMethod* caller_method, int caller_bci, ciCallProfile& profile, WarmCallInfo* wci_result, bool& should_delay); const char* try_to_inline(ciMethod* callee_method, ciMethod* caller_method, int caller_bci, ciCallProfile& profile, WarmCallInfo* wci_result, bool& should_delay);
const char* should_inline(ciMethod* callee_method, ciMethod* caller_method, int caller_bci, ciCallProfile& profile, WarmCallInfo* wci_result) const; const char* should_inline(ciMethod* callee_method, ciMethod* caller_method, int caller_bci, ciCallProfile& profile, WarmCallInfo* wci_result) const;
const char* should_not_inline(ciMethod* callee_method, ciMethod* caller_method, WarmCallInfo* wci_result) const; const char* should_not_inline(ciMethod* callee_method, ciMethod* caller_method, WarmCallInfo* wci_result) const;
void print_inlining(ciMethod *callee_method, int caller_bci, const char *failure_msg) const; void print_inlining(ciMethod* callee_method, int caller_bci,
const char* msg, bool success) const;
InlineTree *caller_tree() const { return _caller_tree; } InlineTree *caller_tree() const { return _caller_tree; }
InlineTree* callee_at(int bci, ciMethod* m) const; InlineTree* callee_at(int bci, ciMethod* m) const;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册