src/share/vm/opto/bytecodeInfo.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File
7022998 Cdiff src/share/vm/opto/bytecodeInfo.cpp
src/share/vm/opto/bytecodeInfo.cpp
Print this page
*** 23,32 ****
--- 23,33 ----
*/
#include "precompiled.hpp"
#include "classfile/systemDictionary.hpp"
#include "classfile/vmSymbols.hpp"
+ #include "compiler/compileBroker.hpp"
#include "compiler/compileLog.hpp"
#include "interpreter/linkResolver.hpp"
#include "oops/objArrayKlass.hpp"
#include "opto/callGenerator.hpp"
#include "opto/parse.hpp"
*** 73,89 ****
{
NOT_PRODUCT(_count_inlines = 0;)
assert(!UseOldInlining, "do not use for old stuff");
}
-
-
- static void print_indent(int depth) {
- tty->print(" ");
- for (int i = depth; i != 0; --i) tty->print(" ");
- }
-
static bool is_init_with_ea(ciMethod* callee_method,
ciMethod* caller_method, Compile* C) {
// True when EA is ON and a java constructor is called or
// a super constructor is called from an inlined java constructor.
return C->do_escape_analysis() && EliminateAllocations &&
--- 74,83 ----
*** 98,108 ****
const char* InlineTree::shouldInline(ciMethod* callee_method, ciMethod* caller_method, int caller_bci, ciCallProfile& profile, WarmCallInfo* wci_result) const {
// Allows targeted inlining
if(callee_method->should_inline()) {
*wci_result = *(WarmCallInfo::always_hot());
if (PrintInlining && Verbose) {
! print_indent(inline_depth());
tty->print_cr("Inlined method is hot: ");
}
return NULL;
}
--- 92,102 ----
const char* InlineTree::shouldInline(ciMethod* callee_method, ciMethod* caller_method, int caller_bci, ciCallProfile& profile, WarmCallInfo* wci_result) const {
// Allows targeted inlining
if(callee_method->should_inline()) {
*wci_result = *(WarmCallInfo::always_hot());
if (PrintInlining && Verbose) {
! CompileTask::print_inline_indent(inline_depth());
tty->print_cr("Inlined method is hot: ");
}
return NULL;
}
*** 114,124 ****
// Check for too many throws (and not too huge)
if(callee_method->interpreter_throwout_count() > InlineThrowCount &&
size < InlineThrowMaxSize ) {
wci_result->set_profit(wci_result->profit() * 100);
if (PrintInlining && Verbose) {
! print_indent(inline_depth());
tty->print_cr("Inlined method with many throws (throws=%d):", callee_method->interpreter_throwout_count());
}
return NULL;
}
--- 108,118 ----
// Check for too many throws (and not too huge)
if(callee_method->interpreter_throwout_count() > InlineThrowCount &&
size < InlineThrowMaxSize ) {
wci_result->set_profit(wci_result->profit() * 100);
if (PrintInlining && Verbose) {
! CompileTask::print_inline_indent(inline_depth());
tty->print_cr("Inlined method with many throws (throws=%d):", callee_method->interpreter_throwout_count());
}
return NULL;
}
*** 136,148 ****
(call_site_count >= InlineFrequencyCount) ||
is_init_with_ea(callee_method, caller_method, C)) {
max_size = C->freq_inline_size();
if (size <= max_size && TraceFrequencyInlining) {
! print_indent(inline_depth());
tty->print_cr("Inlined frequent method (freq=%d count=%d):", freq, call_site_count);
! print_indent(inline_depth());
callee_method->print();
tty->cr();
}
} else {
// Not hot. Check for medium-sized pre-existing nmethod at cold sites.
--- 130,142 ----
(call_site_count >= InlineFrequencyCount) ||
is_init_with_ea(callee_method, caller_method, C)) {
max_size = C->freq_inline_size();
if (size <= max_size && TraceFrequencyInlining) {
! CompileTask::print_inline_indent(inline_depth());
tty->print_cr("Inlined frequent method (freq=%d count=%d):", freq, call_site_count);
! CompileTask::print_inline_indent(inline_depth());
callee_method->print();
tty->cr();
}
} else {
// Not hot. Check for medium-sized pre-existing nmethod at cold sites.
*** 313,324 ****
return "not an accessor";
}
if( inline_depth() > MaxInlineLevel ) {
return "inlining too deep";
}
! if( method() == callee_method &&
! inline_depth() > MaxRecursiveInlineLevel ) {
return "recursively inlining too deep";
}
int size = callee_method->code_size();
--- 307,335 ----
return "not an accessor";
}
if( inline_depth() > MaxInlineLevel ) {
return "inlining too deep";
}
!
! // We need to detect recursive inlining of method handle targets: if
! // the current method is a method handle adapter and one of the
! // callers is the same method as the callee, we bail out if
! // MaxRecursiveInlineLevel is hit.
! if (method()->is_method_handle_adapter()) {
! JVMState* jvms = caller_jvms();
! int inline_level = 0;
! while (jvms != NULL && jvms->has_method()) {
! if (jvms->method() == callee_method) {
! inline_level++;
! if (inline_level > MaxRecursiveInlineLevel)
! return "recursively inlining too deep";
! }
! jvms = jvms->caller();
! }
! }
!
! if (method() == callee_method && inline_depth() > MaxRecursiveInlineLevel) {
return "recursively inlining too deep";
}
int size = callee_method->code_size();
*** 366,387 ****
}
#ifndef PRODUCT
//------------------------------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 {
! print_indent(inline_depth());
! tty->print("@ %d ", caller_bci);
! if( callee_method ) callee_method->print_short_name();
! else tty->print(" callee not monotonic or profiled");
! tty->print(" %s", (failure_msg ? failure_msg : "inline"));
! 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());
}
- tty->cr();
}
#endif
//------------------------------ok_to_inline-----------------------------------
WarmCallInfo* InlineTree::ok_to_inline(ciMethod* callee_method, JVMState* jvms, ciCallProfile& profile, WarmCallInfo* initial_wci) {
--- 377,394 ----
}
#ifndef PRODUCT
//------------------------------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 {
! CompileTask::print_inlining(callee_method, inline_depth(), 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());
}
}
#endif
//------------------------------ok_to_inline-----------------------------------
WarmCallInfo* InlineTree::ok_to_inline(ciMethod* callee_method, JVMState* jvms, ciCallProfile& profile, WarmCallInfo* initial_wci) {
src/share/vm/opto/bytecodeInfo.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File