hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp
changeset 46630 75aa3e39d02c
parent 46625 edefffab74e2
equal deleted inserted replaced
46629:8eeacdc76bf2 46630:75aa3e39d02c
     1 /*
     1 /*
     2  * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2005, 2017, 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.
   264       code = Bytecodes::_invokespecial;
   264       code = Bytecodes::_invokespecial;
   265       break;
   265       break;
   266     case Bytecodes::_invokehandle:
   266     case Bytecodes::_invokehandle:
   267       code = target->is_static() ? Bytecodes::_invokestatic : Bytecodes::_invokespecial;
   267       code = target->is_static() ? Bytecodes::_invokestatic : Bytecodes::_invokespecial;
   268       break;
   268       break;
       
   269     default:
       
   270       break;
   269     }
   271     }
   270   }
   272   }
   271 
   273 
   272   // compute size of arguments
   274   // compute size of arguments
   273   int arg_size = target->invoke_arg_size(code);
   275   int arg_size = target->invoke_arg_size(code);
   299   }
   301   }
   300 
   302 
   301   // determine actual method (use CHA if necessary)
   303   // determine actual method (use CHA if necessary)
   302   ciMethod* inline_target = NULL;
   304   ciMethod* inline_target = NULL;
   303   if (target->is_loaded() && klass->is_loaded()
   305   if (target->is_loaded() && klass->is_loaded()
   304       && (klass->is_initialized() || klass->is_interface() && target->holder()->is_initialized())
   306       && (klass->is_initialized() || (klass->is_interface() && target->holder()->is_initialized()))
   305       && target->is_loaded()) {
   307       && target->is_loaded()) {
   306     if (code == Bytecodes::_invokestatic
   308     if (code == Bytecodes::_invokestatic
   307         || code == Bytecodes::_invokespecial
   309         || code == Bytecodes::_invokespecial
   308         || code == Bytecodes::_invokevirtual && target->is_final_method()) {
   310         || (code == Bytecodes::_invokevirtual && target->is_final_method())) {
   309       inline_target = target;
   311       inline_target = target;
   310     } else {
   312     } else {
   311       inline_target = target->find_monomorphic_target(calling_klass, callee_holder, actual_recv);
   313       inline_target = target->find_monomorphic_target(calling_klass, callee_holder, actual_recv);
   312     }
   314     }
   313   }
   315   }
   340     }
   342     }
   341     _unknown_modified = _unknown_modified || analyzer.has_non_arg_side_affects();
   343     _unknown_modified = _unknown_modified || analyzer.has_non_arg_side_affects();
   342 
   344 
   343     // record dependencies if at least one parameter retained stack-allocatable
   345     // record dependencies if at least one parameter retained stack-allocatable
   344     if (must_record_dependencies) {
   346     if (must_record_dependencies) {
   345       if (code == Bytecodes::_invokeinterface || code == Bytecodes::_invokevirtual && !target->is_final_method()) {
   347       if (code == Bytecodes::_invokeinterface ||
       
   348           (code == Bytecodes::_invokevirtual && !target->is_final_method())) {
   346         _dependencies.append(actual_recv);
   349         _dependencies.append(actual_recv);
   347         _dependencies.append(inline_target);
   350         _dependencies.append(inline_target);
   348       }
   351       }
   349       _dependencies.appendAll(analyzer.dependencies());
   352       _dependencies.appendAll(analyzer.dependencies());
   350     }
   353     }