< prev index next >

src/hotspot/share/ci/ciField.cpp

Print this page




 374   // Check for static/nonstatic mismatch
 375   bool is_static = (bc == Bytecodes::_getstatic || bc == Bytecodes::_putstatic);
 376   if (is_static != this->is_static()) {
 377     return false;
 378   }
 379 
 380   // Get and put can have different accessibility rules
 381   bool is_put    = (bc == Bytecodes::_putfield  || bc == Bytecodes::_putstatic);
 382   if (is_put) {
 383     if (_known_to_link_with_put == accessing_method) {
 384       return true;
 385     }
 386   } else {
 387     if (_known_to_link_with_get == accessing_method->holder()) {
 388       return true;
 389     }
 390   }
 391 
 392   LinkInfo link_info(_holder->get_instanceKlass(),
 393                      _name->get_symbol(), _signature->get_symbol(),
 394                      accessing_method->get_Method());
 395   fieldDescriptor result;
 396   LinkResolver::resolve_field(result, link_info, bc, false, KILL_COMPILE_ON_FATAL_(false));
 397 
 398   // update the hit-cache, unless there is a problem with memory scoping:
 399   if (accessing_method->holder()->is_shared() || !is_shared()) {
 400     if (is_put) {
 401       _known_to_link_with_put = accessing_method;
 402     } else {
 403       _known_to_link_with_get = accessing_method->holder();
 404     }
 405   }
 406 
 407   return true;
 408 }
 409 
 410 // ------------------------------------------------------------------
 411 // ciField::print
 412 void ciField::print() {
 413   tty->print("<ciField name=");
 414   _holder->print_name();




 374   // Check for static/nonstatic mismatch
 375   bool is_static = (bc == Bytecodes::_getstatic || bc == Bytecodes::_putstatic);
 376   if (is_static != this->is_static()) {
 377     return false;
 378   }
 379 
 380   // Get and put can have different accessibility rules
 381   bool is_put    = (bc == Bytecodes::_putfield  || bc == Bytecodes::_putstatic);
 382   if (is_put) {
 383     if (_known_to_link_with_put == accessing_method) {
 384       return true;
 385     }
 386   } else {
 387     if (_known_to_link_with_get == accessing_method->holder()) {
 388       return true;
 389     }
 390   }
 391 
 392   LinkInfo link_info(_holder->get_instanceKlass(),
 393                      _name->get_symbol(), _signature->get_symbol(),
 394                      methodHandle(THREAD, accessing_method->get_Method()));
 395   fieldDescriptor result;
 396   LinkResolver::resolve_field(result, link_info, bc, false, KILL_COMPILE_ON_FATAL_(false));
 397 
 398   // update the hit-cache, unless there is a problem with memory scoping:
 399   if (accessing_method->holder()->is_shared() || !is_shared()) {
 400     if (is_put) {
 401       _known_to_link_with_put = accessing_method;
 402     } else {
 403       _known_to_link_with_get = accessing_method->holder();
 404     }
 405   }
 406 
 407   return true;
 408 }
 409 
 410 // ------------------------------------------------------------------
 411 // ciField::print
 412 void ciField::print() {
 413   tty->print("<ciField name=");
 414   _holder->print_name();


< prev index next >