src/share/vm/opto/bytecodeInfo.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 7071307 Sdiff src/share/vm/opto

src/share/vm/opto/bytecodeInfo.cpp

Print this page




 124     return NULL;  // size and frequency are represented in a new way
 125   }
 126 
 127   int default_max_inline_size = C->max_inline_size();
 128   int inline_small_code_size  = InlineSmallCode / 4;
 129   int max_inline_size         = default_max_inline_size;
 130 
 131   int call_site_count  = method()->scale_count(profile.count());
 132   int invoke_count     = method()->interpreter_invocation_count();
 133 
 134   // Bytecoded method handle adapters do not have interpreter
 135   // profiling data but only made up MDO data.  Get the counter from
 136   // there.
 137   if (caller_method->is_method_handle_adapter()) {
 138     assert(method()->method_data_or_null(), "must have an MDO");
 139     ciMethodData* mdo = method()->method_data();
 140     ciProfileData* mha_profile = mdo->bci_to_data(caller_bci);
 141     assert(mha_profile, "must exist");
 142     CounterData* cd = mha_profile->as_CounterData();
 143     invoke_count = cd->count();













 144     call_site_count = invoke_count;  // use the same value
 145   }

 146 
 147   assert(invoke_count != 0, "require invocation count greater than zero");
 148   int freq = call_site_count / invoke_count;
 149 
 150   // bump the max size if the call is frequent
 151   if ((freq >= InlineFrequencyRatio) ||
 152       (call_site_count >= InlineFrequencyCount) ||
 153       is_init_with_ea(callee_method, caller_method, C)) {
 154 
 155     max_inline_size = C->freq_inline_size();
 156     if (size <= max_inline_size && TraceFrequencyInlining) {
 157       CompileTask::print_inline_indent(inline_level());
 158       tty->print_cr("Inlined frequent method (freq=%d count=%d):", freq, call_site_count);
 159       CompileTask::print_inline_indent(inline_level());
 160       callee_method->print();
 161       tty->cr();
 162     }
 163   } else {
 164     // Not hot.  Check for medium-sized pre-existing nmethod at cold sites.
 165     if (callee_method->has_compiled_code() &&




 124     return NULL;  // size and frequency are represented in a new way
 125   }
 126 
 127   int default_max_inline_size = C->max_inline_size();
 128   int inline_small_code_size  = InlineSmallCode / 4;
 129   int max_inline_size         = default_max_inline_size;
 130 
 131   int call_site_count  = method()->scale_count(profile.count());
 132   int invoke_count     = method()->interpreter_invocation_count();
 133 
 134   // Bytecoded method handle adapters do not have interpreter
 135   // profiling data but only made up MDO data.  Get the counter from
 136   // there.
 137   if (caller_method->is_method_handle_adapter()) {
 138     assert(method()->method_data_or_null(), "must have an MDO");
 139     ciMethodData* mdo = method()->method_data();
 140     ciProfileData* mha_profile = mdo->bci_to_data(caller_bci);
 141     assert(mha_profile, "must exist");
 142     CounterData* cd = mha_profile->as_CounterData();
 143     invoke_count = cd->count();
 144     if (invoke_count == 0) {
 145       return "method handle not reached";
 146     }
 147 
 148     if (_caller_jvms != NULL && _caller_jvms->method() != NULL &&
 149         _caller_jvms->method()->method_data() != NULL &&
 150         !_caller_jvms->method()->method_data()->is_empty()) {
 151       ciMethodData* mdo = _caller_jvms->method()->method_data();
 152       ciProfileData* mha_profile = mdo->bci_to_data(_caller_jvms->bci());
 153       assert(mha_profile, "must exist");
 154       CounterData* cd = mha_profile->as_CounterData();
 155       call_site_count = cd->count();
 156     } else {
 157       call_site_count = invoke_count;  // use the same value
 158     }
 159   }
 160 
 161   assert(invoke_count != 0, "require invocation count greater than zero");
 162   int freq = call_site_count / invoke_count;
 163 
 164   // bump the max size if the call is frequent
 165   if ((freq >= InlineFrequencyRatio) ||
 166       (call_site_count >= InlineFrequencyCount) ||
 167       is_init_with_ea(callee_method, caller_method, C)) {
 168 
 169     max_inline_size = C->freq_inline_size();
 170     if (size <= max_inline_size && TraceFrequencyInlining) {
 171       CompileTask::print_inline_indent(inline_level());
 172       tty->print_cr("Inlined frequent method (freq=%d count=%d):", freq, call_site_count);
 173       CompileTask::print_inline_indent(inline_level());
 174       callee_method->print();
 175       tty->cr();
 176     }
 177   } else {
 178     // Not hot.  Check for medium-sized pre-existing nmethod at cold sites.
 179     if (callee_method->has_compiled_code() &&


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