< prev index next >

src/hotspot/share/interpreter/abstractInterpreter.cpp

Print this page




 250     assert(!Bytecodes::must_rewrite(code), "invokes aren't rewritten");
 251     ConstantPool* cpool = method()->constants();
 252 
 253     Bytecode invoke_bc(s.bytecode());
 254 
 255     switch (code) {
 256       case Bytecodes::_invokedynamic: {
 257         assert(invoke_bc.has_index_u4(code), "sanity");
 258         int method_index = invoke_bc.get_index_u4(code);
 259         return cpool->invokedynamic_cp_cache_entry_at(method_index)->is_f1_null();
 260       }
 261       case Bytecodes::_invokevirtual:   // fall-through
 262       case Bytecodes::_invokeinterface: // fall-through
 263       case Bytecodes::_invokespecial:   // fall-through
 264       case Bytecodes::_invokestatic: {
 265         if (cpool->has_preresolution()) {
 266           return false; // might have been reached
 267         }
 268         assert(!invoke_bc.has_index_u4(code), "sanity");
 269         int method_index = invoke_bc.get_index_u2_cpcache(code);
 270         Method* resolved_method = ConstantPool::method_at_if_loaded(cpool, method_index);

 271         return (resolved_method == NULL);
 272       }
 273       default: ShouldNotReachHere();
 274     }
 275   } else if (!Bytecodes::must_rewrite(code)) {
 276     // might have been reached
 277     return false;
 278   }
 279 
 280   // the bytecode might not be rewritten if the method is an accessor, etc.
 281   address ientry = method->interpreter_entry();
 282   if (ientry != entry_for_kind(AbstractInterpreter::zerolocals) &&
 283       ientry != entry_for_kind(AbstractInterpreter::zerolocals_synchronized))
 284     return false;  // interpreter does not run this method!
 285 
 286   // otherwise, we can be sure this bytecode has never been executed
 287   return true;
 288 }
 289 
 290 




 250     assert(!Bytecodes::must_rewrite(code), "invokes aren't rewritten");
 251     ConstantPool* cpool = method()->constants();
 252 
 253     Bytecode invoke_bc(s.bytecode());
 254 
 255     switch (code) {
 256       case Bytecodes::_invokedynamic: {
 257         assert(invoke_bc.has_index_u4(code), "sanity");
 258         int method_index = invoke_bc.get_index_u4(code);
 259         return cpool->invokedynamic_cp_cache_entry_at(method_index)->is_f1_null();
 260       }
 261       case Bytecodes::_invokevirtual:   // fall-through
 262       case Bytecodes::_invokeinterface: // fall-through
 263       case Bytecodes::_invokespecial:   // fall-through
 264       case Bytecodes::_invokestatic: {
 265         if (cpool->has_preresolution()) {
 266           return false; // might have been reached
 267         }
 268         assert(!invoke_bc.has_index_u4(code), "sanity");
 269         int method_index = invoke_bc.get_index_u2_cpcache(code);
 270         constantPoolHandle cp(Thread::current(), cpool);
 271         Method* resolved_method = ConstantPool::method_at_if_loaded(cp, method_index);
 272         return (resolved_method == NULL);
 273       }
 274       default: ShouldNotReachHere();
 275     }
 276   } else if (!Bytecodes::must_rewrite(code)) {
 277     // might have been reached
 278     return false;
 279   }
 280 
 281   // the bytecode might not be rewritten if the method is an accessor, etc.
 282   address ientry = method->interpreter_entry();
 283   if (ientry != entry_for_kind(AbstractInterpreter::zerolocals) &&
 284       ientry != entry_for_kind(AbstractInterpreter::zerolocals_synchronized))
 285     return false;  // interpreter does not run this method!
 286 
 287   // otherwise, we can be sure this bytecode has never been executed
 288   return true;
 289 }
 290 
 291 


< prev index next >