< prev index next >

src/hotspot/share/ci/ciField.cpp

Print this page




 357       type_is_also_shared = !ciObjectFactory::is_initialized();
 358     }
 359     if (!type_is_also_shared)
 360       return type;              // Bummer.
 361   }
 362   _type = type;
 363   return type;
 364 }
 365 
 366 
 367 // ------------------------------------------------------------------
 368 // ciField::will_link
 369 //
 370 // Can a specific access to this field be made without causing
 371 // link errors?
 372 bool ciField::will_link(ciMethod* accessing_method,
 373                         Bytecodes::Code bc) {
 374   VM_ENTRY_MARK;
 375   assert(bc == Bytecodes::_getstatic || bc == Bytecodes::_putstatic ||
 376          bc == Bytecodes::_getfield  || bc == Bytecodes::_putfield  ||
 377          bc == Bytecodes::_vwithfield, "unexpected bytecode");
 378 
 379   if (_offset == -1) {
 380     // at creation we couldn't link to our holder so we need to
 381     // maintain that stance, otherwise there's no safe way to use this
 382     // ciField.
 383     return false;
 384   }
 385 
 386   // Check for static/nonstatic mismatch
 387   bool is_static = (bc == Bytecodes::_getstatic || bc == Bytecodes::_putstatic);
 388   if (is_static != this->is_static()) {
 389     return false;
 390   }
 391 
 392   // Get and put can have different accessibility rules
 393   bool is_put    = (bc == Bytecodes::_putfield  || bc == Bytecodes::_putstatic);
 394   if (is_put) {
 395     if (_known_to_link_with_put == accessing_method) {
 396       return true;
 397     }




 357       type_is_also_shared = !ciObjectFactory::is_initialized();
 358     }
 359     if (!type_is_also_shared)
 360       return type;              // Bummer.
 361   }
 362   _type = type;
 363   return type;
 364 }
 365 
 366 
 367 // ------------------------------------------------------------------
 368 // ciField::will_link
 369 //
 370 // Can a specific access to this field be made without causing
 371 // link errors?
 372 bool ciField::will_link(ciMethod* accessing_method,
 373                         Bytecodes::Code bc) {
 374   VM_ENTRY_MARK;
 375   assert(bc == Bytecodes::_getstatic || bc == Bytecodes::_putstatic ||
 376          bc == Bytecodes::_getfield  || bc == Bytecodes::_putfield  ||
 377          bc == Bytecodes::_withfield, "unexpected bytecode");
 378 
 379   if (_offset == -1) {
 380     // at creation we couldn't link to our holder so we need to
 381     // maintain that stance, otherwise there's no safe way to use this
 382     // ciField.
 383     return false;
 384   }
 385 
 386   // Check for static/nonstatic mismatch
 387   bool is_static = (bc == Bytecodes::_getstatic || bc == Bytecodes::_putstatic);
 388   if (is_static != this->is_static()) {
 389     return false;
 390   }
 391 
 392   // Get and put can have different accessibility rules
 393   bool is_put    = (bc == Bytecodes::_putfield  || bc == Bytecodes::_putstatic);
 394   if (is_put) {
 395     if (_known_to_link_with_put == accessing_method) {
 396       return true;
 397     }


< prev index next >