Print this page
rev 1082 : [mq]: indy.compiler.patch

Split Close
Expand all
Collapse all
          --- old/src/share/vm/opto/bytecodeInfo.cpp
          +++ new/src/share/vm/opto/bytecodeInfo.cpp
↓ open down ↓ 314 lines elided ↑ open up ↑
 315  315    // Check if a callee_method was suggested
 316  316    if( callee_method == NULL )            return false;
 317  317    // Check if klass of callee_method is loaded
 318  318    if( !callee_holder->is_loaded() )      return false;
 319  319    if( !callee_holder->is_initialized() ) return false;
 320  320    if( !UseInterpreter || CompileTheWorld /* running Xcomp or CTW */ ) {
 321  321      // Checks that constant pool's call site has been visited
 322  322      // stricter than callee_holder->is_initialized()
 323  323      ciBytecodeStream iter(caller_method);
 324  324      iter.force_bci(caller_bci);
 325      -    int index = iter.get_index_int();
 326      -    if( !caller_method->is_klass_loaded(index, true) ) {
 327      -      return false;
 328      -    }
 329      -    // Try to do constant pool resolution if running Xcomp
 330  325      Bytecodes::Code call_bc = iter.cur_bc();
 331      -    if( !caller_method->check_call(index, call_bc == Bytecodes::_invokestatic) ) {
 332      -      return false;
      326 +    // An invokedynamic instruction does not have a klass.
      327 +    if (call_bc != Bytecodes::_invokedynamic) {
      328 +      int index = iter.get_index_int();
      329 +      if (!caller_method->is_klass_loaded(index, true)) {
      330 +        return false;
      331 +      }
      332 +      // Try to do constant pool resolution if running Xcomp
      333 +      if( !caller_method->check_call(index, call_bc == Bytecodes::_invokestatic) ) {
      334 +        return false;
      335 +      }
 333  336      }
 334  337    }
 335  338    // We will attempt to see if a class/field/etc got properly loaded.  If it
 336  339    // did not, it may attempt to throw an exception during our probing.  Catch
 337  340    // and ignore such exceptions and do not attempt to compile the method.
 338  341    if( callee_method->should_exclude() )  return false;
 339  342  
 340  343    return true;
 341  344  }
 342  345  
↓ open down ↓ 173 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX