7071307: MethodHandle bimorphic inlining should consider the frequency

Reviewed-by: twisti, roland, kvn, iveresov
This commit is contained in:
Tom Rodriguez 2011-09-02 20:58:21 -07:00
parent 1038fed51d
commit 32fd1b087d
20 changed files with 346 additions and 61 deletions

View file

@ -141,7 +141,21 @@ const char* InlineTree::should_inline(ciMethod* callee_method, ciMethod* caller_
assert(mha_profile, "must exist");
CounterData* cd = mha_profile->as_CounterData();
invoke_count = cd->count();
call_site_count = invoke_count; // use the same value
if (invoke_count == 0) {
return "method handle not reached";
}
if (_caller_jvms != NULL && _caller_jvms->method() != NULL &&
_caller_jvms->method()->method_data() != NULL &&
!_caller_jvms->method()->method_data()->is_empty()) {
ciMethodData* mdo = _caller_jvms->method()->method_data();
ciProfileData* mha_profile = mdo->bci_to_data(_caller_jvms->bci());
assert(mha_profile, "must exist");
CounterData* cd = mha_profile->as_CounterData();
call_site_count = cd->count();
} else {
call_site_count = invoke_count; // use the same value
}
}
assert(invoke_count != 0, "require invocation count greater than zero");