提交 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
}
// now perform tests that are based on flag settings
if (callee->force_inline() || callee->should_inline()) {
// ignore heuristic controls on inlining
if (callee->force_inline())
print_inlining(callee, "force inline by annotation");
if (callee->force_inline()) {
print_inlining(callee, "force inline by annotation");
} else if (callee->should_inline()) {
print_inlining(callee, "force inline by CompileOracle");
} else {
// use heuristic controls on inlining
if (inline_level() > MaxInlineLevel ) INLINE_BAILOUT("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");
......
......@@ -420,14 +420,24 @@ const char* InlineTree::check_can_parse(ciMethod* callee) {
}
//------------------------------print_inlining---------------------------------
// Really, the failure_msg can be a success message also.
void InlineTree::print_inlining(ciMethod* callee_method, int caller_bci, const char* failure_msg) const {
C->print_inlining(callee_method, inline_level(), caller_bci, failure_msg ? failure_msg : "inline");
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());
void InlineTree::print_inlining(ciMethod* callee_method, int caller_bci,
const char* msg, bool success) const {
assert(msg != NULL, "just checking");
if (C->log() != NULL) {
if (success) {
C->log()->inline_success(msg);
} else {
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,
// Do some initial checks.
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;
}
// Do some parse checks.
failure_msg = check_can_parse(callee_method);
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;
}
// Check if inlining policy says no.
WarmCallInfo wci = *(initial_wci);
failure_msg = try_to_inline(callee_method, caller_method, caller_bci, profile, &wci, should_delay);
if (failure_msg != NULL && C->log() != NULL) {
C->log()->inline_fail(failure_msg);
}
failure_msg = try_to_inline(callee_method, caller_method, caller_bci, profile,
&wci, should_delay);
#ifndef PRODUCT
if (UseOldInlining && InlineWarmCalls
......@@ -487,7 +497,7 @@ WarmCallInfo* InlineTree::ok_to_inline(ciMethod* callee_method, JVMState* jvms,
wci = *(WarmCallInfo::always_hot());
else
wci = *(WarmCallInfo::always_cold());
}
}
if (!InlineWarmCalls) {
if (!wci.is_cold() && !wci.is_hot()) {
// Do not inline the warm calls.
......@@ -496,11 +506,10 @@ WarmCallInfo* InlineTree::ok_to_inline(ciMethod* callee_method, JVMState* jvms,
}
if (!wci.is_cold()) {
// In -UseOldInlining, the failure_msg may also be a success message.
if (failure_msg == NULL) failure_msg = "inline (hot)";
// 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)
build_inline_tree_for_callee(callee_method, jvms, caller_bci);
if (InlineWarmCalls && !wci.is_hot())
......@@ -509,8 +518,9 @@ WarmCallInfo* InlineTree::ok_to_inline(ciMethod* callee_method, JVMState* jvms,
}
// Do not inline
if (failure_msg == NULL) failure_msg = "too cold to inline";
if (PrintInlining) print_inlining(callee_method, caller_bci, failure_msg);
print_inlining(callee_method, caller_bci,
failure_msg ? failure_msg : "too cold to inline",
false /* !success */ );
return NULL;
}
......
......@@ -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* 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;
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* callee_at(int bci, ciMethod* m) const;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册