hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp
changeset 8063 3b8d1557d967
parent 7397 5b173b4ca846
child 8064 309d15dfd9ae
equal deleted inserted replaced
7912:6d73dee171ea 8063:3b8d1557d967
     1 /*
     1 /*
     2  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   231     code = Bytecodes::_invokespecial;
   231     code = Bytecodes::_invokespecial;
   232   }
   232   }
   233 
   233 
   234   // compute size of arguments
   234   // compute size of arguments
   235   int arg_size = target->arg_size();
   235   int arg_size = target->arg_size();
       
   236   if (code == Bytecodes::_invokedynamic) {
       
   237     assert(!target->is_static(), "receiver explicit in method");
       
   238     arg_size--;  // implicit, not really on stack
       
   239   }
   236   if (!target->is_loaded() && code == Bytecodes::_invokestatic) {
   240   if (!target->is_loaded() && code == Bytecodes::_invokestatic) {
   237     arg_size--;
   241     arg_size--;
   238   }
   242   }
   239   int arg_base = MAX2(state._stack_height - arg_size, 0);
   243   int arg_base = MAX2(state._stack_height - arg_size, 0);
   240 
   244 
   247   // check if analysis of callee can safely be skipped
   251   // check if analysis of callee can safely be skipped
   248   bool skip_callee = true;
   252   bool skip_callee = true;
   249   for (i = state._stack_height - 1; i >= arg_base && skip_callee; i--) {
   253   for (i = state._stack_height - 1; i >= arg_base && skip_callee; i--) {
   250     ArgumentMap arg = state._stack[i];
   254     ArgumentMap arg = state._stack[i];
   251     skip_callee = !is_argument(arg) || !is_arg_stack(arg) || (directly_recursive && arg.is_singleton(i - arg_base));
   255     skip_callee = !is_argument(arg) || !is_arg_stack(arg) || (directly_recursive && arg.is_singleton(i - arg_base));
       
   256   }
       
   257   // For now we conservatively skip invokedynamic.
       
   258   if (code == Bytecodes::_invokedynamic) {
       
   259     skip_callee = true;
   252   }
   260   }
   253   if (skip_callee) {
   261   if (skip_callee) {
   254     TRACE_BCEA(3, tty->print_cr("[EA] skipping method %s::%s", holder->name()->as_utf8(), target->name()->as_utf8()));
   262     TRACE_BCEA(3, tty->print_cr("[EA] skipping method %s::%s", holder->name()->as_utf8(), target->name()->as_utf8()));
   255     for (i = 0; i < arg_size; i++) {
   263     for (i = 0; i < arg_size; i++) {
   256       set_method_escape(state.raw_pop());
   264       set_method_escape(state.raw_pop());