mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 19:14:38 +02:00
7078382: JSR 292: don't count method handle adapters against inlining budgets
Reviewed-by: kvn, never
This commit is contained in:
parent
5903a384b4
commit
05b60b3662
6 changed files with 41 additions and 7 deletions
|
@ -1016,6 +1016,34 @@ int ciMethod::highest_osr_comp_level() {
|
|||
return get_methodOop()->highest_osr_comp_level();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// ciMethod::code_size_for_inlining
|
||||
//
|
||||
// Code size for inlining decisions.
|
||||
//
|
||||
// Don't fully count method handle adapters against inlining budgets:
|
||||
// the metric we use here is the number of call sites in the adapter
|
||||
// as they are probably the instructions which generate some code.
|
||||
int ciMethod::code_size_for_inlining() {
|
||||
check_is_loaded();
|
||||
|
||||
// Method handle adapters
|
||||
if (is_method_handle_adapter()) {
|
||||
// Count call sites
|
||||
int call_site_count = 0;
|
||||
ciBytecodeStream iter(this);
|
||||
while (iter.next() != ciBytecodeStream::EOBC()) {
|
||||
if (Bytecodes::is_invoke(iter.cur_bc())) {
|
||||
call_site_count++;
|
||||
}
|
||||
}
|
||||
return call_site_count;
|
||||
}
|
||||
|
||||
// Normal method
|
||||
return code_size();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// ciMethod::instructions_size
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue