comparison src/share/vm/opto/bytecodeInfo.cpp @ 3897:de847cac9235

7078382: JSR 292: don't count method handle adapters against inlining budgets Reviewed-by: kvn, never
author twisti
date Wed, 31 Aug 2011 01:40:45 -0700
parents aabf25fa3f05
children a32de5085326
comparison
equal deleted inserted replaced
3896:b346f13112d8 3897:de847cac9235
43 _caller_jvms(caller_jvms), 43 _caller_jvms(caller_jvms),
44 _caller_tree((InlineTree*) caller_tree), 44 _caller_tree((InlineTree*) caller_tree),
45 _method(callee), 45 _method(callee),
46 _site_invoke_ratio(site_invoke_ratio), 46 _site_invoke_ratio(site_invoke_ratio),
47 _max_inline_level(max_inline_level), 47 _max_inline_level(max_inline_level),
48 _count_inline_bcs(method()->code_size()) 48 _count_inline_bcs(method()->code_size_for_inlining())
49 { 49 {
50 NOT_PRODUCT(_count_inlines = 0;) 50 NOT_PRODUCT(_count_inlines = 0;)
51 if (_caller_jvms != NULL) { 51 if (_caller_jvms != NULL) {
52 // Keep a private copy of the caller_jvms: 52 // Keep a private copy of the caller_jvms:
53 _caller_jvms = new (C) JVMState(caller_jvms->method(), caller_tree->caller_jvms()); 53 _caller_jvms = new (C) JVMState(caller_jvms->method(), caller_tree->caller_jvms());
105 return NULL; 105 return NULL;
106 } 106 }
107 107
108 // positive filter: should send be inlined? returns NULL (--> yes) 108 // positive filter: should send be inlined? returns NULL (--> yes)
109 // or rejection msg 109 // or rejection msg
110 int size = callee_method->code_size(); 110 int size = callee_method->code_size_for_inlining();
111 111
112 // Check for too many throws (and not too huge) 112 // Check for too many throws (and not too huge)
113 if(callee_method->interpreter_throwout_count() > InlineThrowCount && 113 if(callee_method->interpreter_throwout_count() > InlineThrowCount &&
114 size < InlineThrowMaxSize ) { 114 size < InlineThrowMaxSize ) {
115 wci_result->set_profit(wci_result->profit() * 100); 115 wci_result->set_profit(wci_result->profit() * 100);
242 if (!k->is_subclass_of(C->env()->Throwable_klass())) 242 if (!k->is_subclass_of(C->env()->Throwable_klass()))
243 return "exception method"; 243 return "exception method";
244 } 244 }
245 245
246 // use frequency-based objections only for non-trivial methods 246 // use frequency-based objections only for non-trivial methods
247 if (callee_method->code_size() <= MaxTrivialSize) return NULL; 247 if (callee_method->code_size_for_inlining() <= MaxTrivialSize) return NULL;
248 248
249 // don't use counts with -Xcomp or CTW 249 // don't use counts with -Xcomp or CTW
250 if (UseInterpreter && !CompileTheWorld) { 250 if (UseInterpreter && !CompileTheWorld) {
251 251
252 if (!callee_method->has_compiled_code() && 252 if (!callee_method->has_compiled_code() &&
303 // accessor methods are not subject to any of the following limits. 303 // accessor methods are not subject to any of the following limits.
304 return NULL; 304 return NULL;
305 } 305 }
306 306
307 // suppress a few checks for accessors and trivial methods 307 // suppress a few checks for accessors and trivial methods
308 if (callee_method->code_size() > MaxTrivialSize) { 308 if (callee_method->code_size_for_inlining() > MaxTrivialSize) {
309 309
310 // don't inline into giant methods 310 // don't inline into giant methods
311 if (C->unique() > (uint)NodeCountInliningCutoff) { 311 if (C->unique() > (uint)NodeCountInliningCutoff) {
312 return "NodeCountInliningCutoff"; 312 return "NodeCountInliningCutoff";
313 } 313 }
347 } 347 }
348 jvms = jvms->caller(); 348 jvms = jvms->caller();
349 } 349 }
350 } 350 }
351 351
352 int size = callee_method->code_size(); 352 int size = callee_method->code_size_for_inlining();
353 353
354 if (UseOldInlining && ClipInlining 354 if (UseOldInlining && ClipInlining
355 && (int)count_inline_bcs() + size >= DesiredMethodLimit) { 355 && (int)count_inline_bcs() + size >= DesiredMethodLimit) {
356 return "size > DesiredMethodLimit"; 356 return "size > DesiredMethodLimit";
357 } 357 }