comparison src/share/vm/ci/ciMethod.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 2c359f27615c
children 5eb9169b1a14
comparison
equal deleted inserted replaced
3896:b346f13112d8 3897:de847cac9235
1015 VM_ENTRY_MARK; 1015 VM_ENTRY_MARK;
1016 return get_methodOop()->highest_osr_comp_level(); 1016 return get_methodOop()->highest_osr_comp_level();
1017 } 1017 }
1018 1018
1019 // ------------------------------------------------------------------ 1019 // ------------------------------------------------------------------
1020 // ciMethod::code_size_for_inlining
1021 //
1022 // Code size for inlining decisions.
1023 //
1024 // Don't fully count method handle adapters against inlining budgets:
1025 // the metric we use here is the number of call sites in the adapter
1026 // as they are probably the instructions which generate some code.
1027 int ciMethod::code_size_for_inlining() {
1028 check_is_loaded();
1029
1030 // Method handle adapters
1031 if (is_method_handle_adapter()) {
1032 // Count call sites
1033 int call_site_count = 0;
1034 ciBytecodeStream iter(this);
1035 while (iter.next() != ciBytecodeStream::EOBC()) {
1036 if (Bytecodes::is_invoke(iter.cur_bc())) {
1037 call_site_count++;
1038 }
1039 }
1040 return call_site_count;
1041 }
1042
1043 // Normal method
1044 return code_size();
1045 }
1046
1047 // ------------------------------------------------------------------
1020 // ciMethod::instructions_size 1048 // ciMethod::instructions_size
1021 // 1049 //
1022 // This is a rough metric for "fat" methods, compared before inlining 1050 // This is a rough metric for "fat" methods, compared before inlining
1023 // with InlineSmallCode. The CodeBlob::code_size accessor includes 1051 // with InlineSmallCode. The CodeBlob::code_size accessor includes
1024 // junk like exception handler, stubs, and constant table, which are 1052 // junk like exception handler, stubs, and constant table, which are