src/share/vm/ci/bcEscapeAnalyzer.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 6700102 Sdiff src/share/vm/ci

src/share/vm/ci/bcEscapeAnalyzer.cpp

Print this page




 201   int l = offset / HeapWordSize;
 202   int h = round_to(offset + size_in_bytes, HeapWordSize) / HeapWordSize;
 203   if (l > ARG_OFFSET_MAX)
 204     l = ARG_OFFSET_MAX;
 205   if (h > ARG_OFFSET_MAX+1)
 206     h = ARG_OFFSET_MAX + 1;
 207   for (int i = l; i < h; i++) {
 208     _arg_modified[arg] |= (1 << i);
 209   }
 210 }
 211 
 212 void BCEscapeAnalyzer::invoke(StateInfo &state, Bytecodes::Code code, ciMethod* target, ciKlass* holder) {
 213   int i;
 214 
 215   // retrieve information about the callee
 216   ciInstanceKlass* klass = target->holder();
 217   ciInstanceKlass* calling_klass = method()->holder();
 218   ciInstanceKlass* callee_holder = ciEnv::get_instance_klass_for_declared_method_holder(holder);
 219   ciInstanceKlass* actual_recv = callee_holder;
 220 







 221   // compute size of arguments
 222   int arg_size = target->arg_size();
 223   if (!target->is_loaded() && code == Bytecodes::_invokestatic) {
 224     arg_size--;
 225   }
 226   int arg_base = MAX2(state._stack_height - arg_size, 0);
 227 
 228   // direct recursive calls are skipped if they can be bound statically without introducing
 229   // dependencies and if parameters are passed at the same position as in the current method
 230   // other calls are skipped if there are no unescaped arguments passed to them
 231   bool directly_recursive = (method() == target) &&
 232                (code != Bytecodes::_invokevirtual || target->is_final_method() || state._stack[arg_base] .is_empty());
 233 
 234   // check if analysis of callee can safely be skipped
 235   bool skip_callee = true;
 236   for (i = state._stack_height - 1; i >= arg_base && skip_callee; i--) {
 237     ArgumentMap arg = state._stack[i];
 238     skip_callee = !is_argument(arg) || !is_arg_stack(arg) || (directly_recursive && arg.is_singleton(i - arg_base));
 239   }
 240   if (skip_callee) {




 201   int l = offset / HeapWordSize;
 202   int h = round_to(offset + size_in_bytes, HeapWordSize) / HeapWordSize;
 203   if (l > ARG_OFFSET_MAX)
 204     l = ARG_OFFSET_MAX;
 205   if (h > ARG_OFFSET_MAX+1)
 206     h = ARG_OFFSET_MAX + 1;
 207   for (int i = l; i < h; i++) {
 208     _arg_modified[arg] |= (1 << i);
 209   }
 210 }
 211 
 212 void BCEscapeAnalyzer::invoke(StateInfo &state, Bytecodes::Code code, ciMethod* target, ciKlass* holder) {
 213   int i;
 214 
 215   // retrieve information about the callee
 216   ciInstanceKlass* klass = target->holder();
 217   ciInstanceKlass* calling_klass = method()->holder();
 218   ciInstanceKlass* callee_holder = ciEnv::get_instance_klass_for_declared_method_holder(holder);
 219   ciInstanceKlass* actual_recv = callee_holder;
 220 
 221   // some methods are obviously bindable without any type checks so
 222   // convert them directly to an invokespecial.
 223   if (target->is_loaded() && !target->is_abstract() &&
 224       target->can_be_statically_bound() && code == Bytecodes::_invokevirtual) {
 225     code = Bytecodes::_invokespecial;
 226   }
 227 
 228   // compute size of arguments
 229   int arg_size = target->arg_size();
 230   if (!target->is_loaded() && code == Bytecodes::_invokestatic) {
 231     arg_size--;
 232   }
 233   int arg_base = MAX2(state._stack_height - arg_size, 0);
 234 
 235   // direct recursive calls are skipped if they can be bound statically without introducing
 236   // dependencies and if parameters are passed at the same position as in the current method
 237   // other calls are skipped if there are no unescaped arguments passed to them
 238   bool directly_recursive = (method() == target) &&
 239                (code != Bytecodes::_invokevirtual || target->is_final_method() || state._stack[arg_base] .is_empty());
 240 
 241   // check if analysis of callee can safely be skipped
 242   bool skip_callee = true;
 243   for (i = state._stack_height - 1; i >= arg_base && skip_callee; i--) {
 244     ArgumentMap arg = state._stack[i];
 245     skip_callee = !is_argument(arg) || !is_arg_stack(arg) || (directly_recursive && arg.is_singleton(i - arg_base));
 246   }
 247   if (skip_callee) {


src/share/vm/ci/bcEscapeAnalyzer.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File