hotspot/src/share/vm/code/nmethod.cpp
changeset 22223 82e95c562133
parent 21575 6a9645992cee
child 22506 0759c126204d
equal deleted inserted replaced
22222:45a293a4b895 22223:82e95c562133
   457   return NULL;
   457   return NULL;
   458 }
   458 }
   459 
   459 
   460 // Fill in default values for various flag fields
   460 // Fill in default values for various flag fields
   461 void nmethod::init_defaults() {
   461 void nmethod::init_defaults() {
   462   _state                      = alive;
   462   _state                      = in_use;
   463   _marked_for_reclamation     = 0;
   463   _marked_for_reclamation     = 0;
   464   _has_flushed_dependencies   = 0;
   464   _has_flushed_dependencies   = 0;
   465   _has_unsafe_access          = 0;
   465   _has_unsafe_access          = 0;
   466   _has_method_handle_invokes  = 0;
   466   _has_method_handle_invokes  = 0;
   467   _lazy_critical_native       = 0;
   467   _lazy_critical_native       = 0;
  1658           // The only exception is compiledICHolder oops which may
  1658           // The only exception is compiledICHolder oops which may
  1659           // yet be marked below. (We check this further below).
  1659           // yet be marked below. (We check this further below).
  1660           CompiledICHolder* cichk_oop = ic->cached_icholder();
  1660           CompiledICHolder* cichk_oop = ic->cached_icholder();
  1661           if (cichk_oop->holder_method()->method_holder()->is_loader_alive(is_alive) &&
  1661           if (cichk_oop->holder_method()->method_holder()->is_loader_alive(is_alive) &&
  1662               cichk_oop->holder_klass()->is_loader_alive(is_alive)) {
  1662               cichk_oop->holder_klass()->is_loader_alive(is_alive)) {
  1663               continue;
  1663             continue;
  1664             }
  1664           }
  1665         } else {
  1665         } else {
  1666           Metadata* ic_oop = ic->cached_metadata();
  1666           Metadata* ic_oop = ic->cached_metadata();
  1667           if (ic_oop != NULL) {
  1667           if (ic_oop != NULL) {
  1668             if (ic_oop->is_klass()) {
  1668             if (ic_oop->is_klass()) {
  1669               if (((Klass*)ic_oop)->is_loader_alive(is_alive)) {
  1669               if (((Klass*)ic_oop)->is_loader_alive(is_alive)) {
  1675               }
  1675               }
  1676             } else {
  1676             } else {
  1677               ShouldNotReachHere();
  1677               ShouldNotReachHere();
  1678             }
  1678             }
  1679           }
  1679           }
  1680           }
  1680         }
  1681           ic->set_to_clean();
  1681         ic->set_to_clean();
  1682       }
  1682       }
  1683     }
  1683     }
  1684   }
  1684   }
  1685 
  1685 
  1686   // Compiled code
  1686   // Compiled code
  2391 }
  2391 }
  2392 
  2392 
  2393 
  2393 
  2394 void nmethod::verify_interrupt_point(address call_site) {
  2394 void nmethod::verify_interrupt_point(address call_site) {
  2395   // Verify IC only when nmethod installation is finished.
  2395   // Verify IC only when nmethod installation is finished.
  2396   bool is_installed = (method()->code() == this) // nmethod is in state 'alive' and installed
  2396   bool is_installed = (method()->code() == this) // nmethod is in state 'in_use' and installed
  2397                       || !this->is_in_use();     // nmethod is installed, but not in 'alive' state
  2397                       || !this->is_in_use();     // nmethod is installed, but not in 'in_use' state
  2398   if (is_installed) {
  2398   if (is_installed) {
  2399     Thread *cur = Thread::current();
  2399     Thread *cur = Thread::current();
  2400     if (CompiledIC_lock->owner() == cur ||
  2400     if (CompiledIC_lock->owner() == cur ||
  2401         ((cur->is_VM_thread() || cur->is_ConcurrentGC_thread()) &&
  2401         ((cur->is_VM_thread() || cur->is_ConcurrentGC_thread()) &&
  2402          SafepointSynchronize::is_at_safepoint())) {
  2402          SafepointSynchronize::is_at_safepoint())) {