src/share/vm/opto/bytecodeInfo.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 8028468 Cdiff src/share/vm/opto/bytecodeInfo.cpp

src/share/vm/opto/bytecodeInfo.cpp

Print this page

        

*** 48,58 **** _max_inline_level(max_inline_level), _count_inline_bcs(method()->code_size_for_inlining()), _subtrees(c->comp_arena(), 2, 0, NULL), _msg(NULL) { ! NOT_PRODUCT(_count_inlines = 0;) if (_caller_jvms != NULL) { // Keep a private copy of the caller_jvms: _caller_jvms = new (C) JVMState(caller_jvms->method(), caller_tree->caller_jvms()); _caller_jvms->set_bci(caller_jvms->bci()); assert(!caller_jvms->should_reexecute(), "there should be no reexecute bytecode with inlining"); --- 48,61 ---- _max_inline_level(max_inline_level), _count_inline_bcs(method()->code_size_for_inlining()), _subtrees(c->comp_arena(), 2, 0, NULL), _msg(NULL) { ! #ifndef PRODUCT ! _count_inlines = 0; ! _forced_inline = false; ! #endif if (_caller_jvms != NULL) { // Keep a private copy of the caller_jvms: _caller_jvms = new (C) JVMState(caller_jvms->method(), caller_tree->caller_jvms()); _caller_jvms->set_bci(caller_jvms->bci()); assert(!caller_jvms->should_reexecute(), "there should be no reexecute bytecode with inlining");
*** 79,89 **** _site_invoke_ratio(site_invoke_ratio), _max_inline_level(max_inline_level), _count_inline_bcs(method()->code_size()), _msg(NULL) { ! NOT_PRODUCT(_count_inlines = 0;) assert(!UseOldInlining, "do not use for old stuff"); } /** * Return true when EA is ON and a java constructor is called or --- 82,95 ---- _site_invoke_ratio(site_invoke_ratio), _max_inline_level(max_inline_level), _count_inline_bcs(method()->code_size()), _msg(NULL) { ! #ifndef PRODUCT ! _count_inlines = 0; ! _forced_inline = false; ! #endif assert(!UseOldInlining, "do not use for old stuff"); } /** * Return true when EA is ON and a java constructor is called or
*** 126,138 **** --- 132,154 ---- if (C->print_inlining() && Verbose) { CompileTask::print_inline_indent(inline_level()); tty->print_cr("Inlined method is hot: "); } set_msg("force inline by CompilerOracle"); + _forced_inline = true; return true; } + #ifndef PRODUCT + int inline_depth = inline_level()+1; + if (ciReplay::should_inline(C->_replay_inline_data, callee_method, caller_bci, inline_depth)) { + set_msg("force inline by ciReplay"); + _forced_inline = true; + return true; + } + #endif + int size = callee_method->code_size_for_inlining(); // Check for too many throws (and not too huge) if(callee_method->interpreter_throwout_count() > InlineThrowCount && size < InlineThrowMaxSize ) {
*** 262,271 **** --- 278,299 ---- set_msg("disallowed by CompilerOracle"); return true; } #ifndef PRODUCT + int caller_bci = jvms->bci(); + int inline_depth = inline_level()+1; + if (ciReplay::should_inline(C->_replay_inline_data, callee_method, caller_bci, inline_depth)) { + set_msg("force inline by ciReplay"); + return false; + } + + if (ciReplay::should_not_inline(C->_replay_inline_data, callee_method, caller_bci, inline_depth)) { + set_msg("disallowed by ciReplay"); + return true; + } + if (ciReplay::should_not_inline(callee_method)) { set_msg("disallowed by ciReplay"); return true; } #endif
*** 341,350 **** --- 369,379 ---- } else if (!C->inlining_incrementally()) { should_delay = true; } } + _forced_inline = false; // Reset if (!should_inline(callee_method, caller_method, caller_bci, profile, wci_result)) { return false; } if (should_not_inline(callee_method, caller_method, jvms, wci_result)) {
*** 371,384 **** } } if ((!UseInterpreter || CompileTheWorld) && is_init_with_ea(callee_method, caller_method, C)) { - // Escape Analysis stress testing when running Xcomp or CTW: // inline constructors even if they are not reached. ! } else if (profile.count() == 0) { // don't inline unreached call sites set_msg("call site not reached"); return false; } --- 400,413 ---- } } if ((!UseInterpreter || CompileTheWorld) && is_init_with_ea(callee_method, caller_method, C)) { // Escape Analysis stress testing when running Xcomp or CTW: // inline constructors even if they are not reached. ! } else if (forced_inline()) { ! // Inlining was forced by CompilerOracle or ciReplay } else if (profile.count() == 0) { // don't inline unreached call sites set_msg("call site not reached"); return false; }
*** 698,713 **** iltp = sub; } return iltp; } #ifndef PRODUCT void InlineTree::print_impl(outputStream* st, int indent) const { for (int i = 0; i < indent; i++) st->print(" "); ! st->print(" @ %d ", caller_bci()); method()->print_short_name(st); st->cr(); for (int i = 0 ; i < _subtrees.length(); i++) { _subtrees.at(i)->print_impl(st, indent + 2); --- 727,758 ---- iltp = sub; } return iltp; } + // Count number of nodes in this subtree + int InlineTree::count() const { + int result = 1; + for (int i = 0 ; i < _subtrees.length(); i++) { + result += _subtrees.at(i)->count(); + } + return result; + } + + void InlineTree::dump_replay_data(outputStream* out) { + out->print(" %d %d ", inline_level(), caller_bci()); + method()->dump_name_as_ascii(out); + for (int i = 0 ; i < _subtrees.length(); i++) { + _subtrees.at(i)->dump_replay_data(out); + } + } #ifndef PRODUCT void InlineTree::print_impl(outputStream* st, int indent) const { for (int i = 0; i < indent; i++) st->print(" "); ! st->print(" @ %d", caller_bci()); method()->print_short_name(st); st->cr(); for (int i = 0 ; i < _subtrees.length(); i++) { _subtrees.at(i)->print_impl(st, indent + 2);
src/share/vm/opto/bytecodeInfo.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File